Re: New to postgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tirveni yadav <yadav(dot)tirveni(at)gmail(dot)com>
Cc: Ramesh <ramesh4f(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: New to postgreSQL
Date: 2017-09-04 16:40:45
Message-ID: 3359.1504543245@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

tirveni yadav <yadav(dot)tirveni(at)gmail(dot)com> writes:
> On Mon, Sep 4, 2017 at 7:41 PM, Ramesh <ramesh4f(at)gmail(dot)com> wrote:
>> [postgres(at)localhost ~]$ createuser mytest
>> Password:
>> createuser: could not connect to database postgres: FATAL: password
>> authentication failed for user "postgres"

> This could be due to enabling md5 authentication for user postgres.
> And password not yet set up for the user postgres.

On most Linux distros, the default setup is that the postgres database
user has no password --- if it did, everybody and his brother would try
that password first if they wanted to break into a database :-(.
Rather, it's typically set up so that if you are logged in as the
operating system's postgres user, as Ramesh seems to be, it will let
you in automatically based on peer authentication. So it's not clear
why that's not working. Looking at the pg_hba.conf file to see what
the actual authentication setup is would be a good thing.

One idea is that there's a PGHOST environment variable setting that
is affecting how createuser thinks it should connect. Peer auth
only works when you come in through a Unix socket.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Siva Kandasamy 2017-09-04 16:52:19 Re: New to postgreSQL
Previous Message Vasilis Ventirozos 2017-09-04 16:28:03 Re: wal_level not changing