Re: How to behive if I remove password from postgres role - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How to behive if I remove password from postgres role
Date
Msg-id aa604dc4-16d1-ce5c-ce35-f0c15fa1b6ed@aklaver.com
Whole thread Raw
In response to How to behive if I remove password from postgres role  (Raivo Rebane <raivore55@gmail.com>)
List pgsql-general
On 3/15/23 09:02, Raivo Rebane wrote:
> HI
> 
> I wanted to install PostGIS Bundle so that it builds a sample spatial 
> database, but got error - createdb: error: connection to server at 
> "localhost" (::1), port 5432 failed: FATAL:  password authentication 
> failed for user "postgres"
> Then I altered role of postgres so, that password = NULL.
> Now I am in situation that I can't run any postgres command.
> What I must to do ?

Edit the 
pg_hba.conf(https://www.postgresql.org/docs/15/auth-pg-hba-conf.html) so 
that the first local line is set to trust as in the 'Example 21.1. 
Example pg_hba.conf Entries' at the bottom of the file. It may already 
be set that way.

In either case when you connect do not use a host setting e.g. do not do 
host=localhost. This will ensure you are connecting to the local socket 
instead and will be using the trust authentication method and not a 
password. Once you are in you can alter the postgres user to have a 
proper password.

> 
> Regards,
> Raivo
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Arthur Ramsey
Date:
Subject: Re: Table scan on 15.2
Next
From: Tom Lane
Date:
Subject: Re: How to behive if I remove password from postgres role