I had some problems during installation of PostgreSQL and I eventually decided to go for a VM solution managed with vagrant, as explained in postgresql wiki.
(At the beginning my motivation was just to solve the installation issue but I find that a virtual machine solution has many advantages).
I started working with it and everything looked very good. But eventually I wanted to use
tablefunc extension was not installed in the virtual machine, and I can't find a way to install it.
The virtual machine creates a user for the application when you run it first time, which is fine, and it creates a database for the application as well. But if I try to install the extension with the application user
create extension tablefunc;
I get the following error (anyhow expected):
ERROR: permission denied to create extension "tablefunc"
SQL state: 42501
Hint: Must be superuser to create this extension.
The point is that I don't have the password for
postgres user, so I cannot install the extension using
pgAdmin. (This is already an issue that scares me a bit, if I have other problems and I need the administrator. But I've been browsing around and haven't found any comment about this.)
In postgres wiki, link above, it describes a way to connect to the VM as superuser, which I also tried,
vagrant ssh sudo su - postgres
but again when I tried to run the command for the installation I was asked for the password of
postgres user in the database. For example, one of the trials:
postgres@postgresql:~$ psql -h localhost -U postgres -d vic -c 'create extension tablefunc' Password for user postgres: psql: FATAL: password authentication failed for user "postgres"
My question is then, if there is a way to install the extension for the vagrant VM (or anyway to run any command with the superuser). Also, I'll be much happier having the superuser password, so that I could manage everything from
Many thanks for reading and for your help.