Re: How to set password in psql -h -d -U command line? - Mailing list pgsql-general

From Joao Miguel Ferreira
Subject Re: How to set password in psql -h -d -U command line?
Date
Msg-id CALyyT7SwLfFr8Z43zsgdLsmf72gqLkGcVQ0EL0hZCYpGw+8Y5Q@mail.gmail.com
Whole thread Raw
In response to How to set password in psql -h -d -U command line?  (Shaozhong SHI <shishaozhong@gmail.com>)
List pgsql-general
Hello,

I usually use this approach:

PGPASSWORD=secret psql -h 127.0.0.1 -p 5432 -U joao mydatabase

it has the down side that the password is shown in the command. need to be careful about that aspect


On Thu, Apr 28, 2022 at 10:33 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
I tried various ways to set password in psql command line, but got no luck.

Can anyone help?

Regards,

David

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Aw: How to set password in psql -h -d -U command line?
Next
From: Josha Inglis
Date:
Subject: Re: How to set password in psql -h -d -U command line?