Re: PostgreSQL - How to login with my Linux user account - Mailing list pgsql-general

From Ron
Subject Re: PostgreSQL - How to login with my Linux user account
Date
Msg-id f83c6820-af14-1800-5ec2-3e249582f4eb@gmail.com
Whole thread Raw
In response to Re: PostgreSQL - How to login with my Linux user account  (Amn Ojee Uw <amnojeeuw@gmail.com>)
List pgsql-general
On 7/28/23 09:00, Amn Ojee Uw wrote:

First of all, my gratitude to Adrian and David for taking the time to reply to my call for help; a 1k  thanks to you kids.

Having stated the above, PostgreSQL provides a default database namely 'postgres'. Taking advantage of this service, I have change the 'psql' statement to 'psql -d postgres -U my_linux_user_name -W', I then entered my Linux account login password and got this error messages :
$ psql -d postgres -U my_linux_user_name -W
Password:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  Peer authentication failed for user "my_linux_user_name"

I also, using 'postres' account, have created another user account, chispa, who is a superuser; when trying to login as 'chispa' and using the above statement (psql -d postgres -U chispa -W ) PostgreSQL throws the same error message.

What am I doing wrong?
Is there a webpage that explains how to login to PostgreSQL as other than 'postgres'?


https://www.postgresql.org/docs/12/auth-pg-hba-conf.html

You want peer authentication to be able to connect to postgresql as my_linux_username.

--
Born in Arizona, moved to Babylonia.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: AW: Compile static postgres.lib for postgres 15.3 on Windows
Next
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL - How to login with my Linux user account