Re: Suggestion : support for environment variable in initdb to set the superuser password - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Suggestion : support for environment variable in initdb to set the superuser password
Date
Msg-id e4de310d-ac45-4a51-9411-359c4f312cac@eisentraut.org
Whole thread Raw
In response to Suggestion : support for environment variable in initdb to set the superuser password  (Reda Agaoua <reda.agaoua@gmail.com>)
Responses Re: Suggestion : support for environment variable in initdb to set the superuser password
List pgsql-hackers
On 27.05.25 11:43, Reda Agaoua wrote:
> I do believe it can be useful in a variety of settings, but I'm not sure 
> whether this is secure. Specifically, the documentation advises against 
> using PGPASSWORD for connecting to postgres :
> 
> "Use of this environment variable is not recommended for security 
> reasons, as some operating systems allow non-root users to see process 
> environment variables via ps; instead consider using a password file 
> (see Section 32.16)." (32.15. Environment Variables)
> 
> In my opinion, the context for using PGPASSWORD (i.e. connecting to an 
> instance) is very different from that of initdb, where the password is 
> only used once during cluster initialization. So I think the security 
> concerns from section 32.16 may not necessarily apply here.

Well, insecure is insecure.  "Insecure, but it's ok because it's not 
used very often" is not a valid excuse.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Standardize the definition of the subtype field of AlterDomainStmt
Next
From: Tender Wang
Date:
Subject: Re: Standardize the definition of the subtype field of AlterDomainStmt