On Mon, Nov 16, 2015 at 6:26 PM, Alan Hodgson <ahodgson@simkin.ca> wrote:
On Monday, November 16, 2015 05:36:08 PM Michael Convey wrote: > Thank you. Assuming a default Fedora installation, if I am logged in as > Linux user lab and I don't know the Linux "postgres" password, but I do > know the PostgreSQL "postgres" role password; what is the syntax (from the > Linux command line) to login as the "postgres" role and connect to the > "postgres" database?
psql -U postgres postgres
It'll prompt for the password.
Make sure you've enabled md5 or password as an authentication method allowed for local in pg_hba.conf.
Thank you. I received the following error:
bash-4.2 ~ $ psql -U postgres postgres
psql: FATAL: Peer authentication failed for user "postgres"
Here's the relevant portion of my pg_hba.conf file: