Re: How to set password in psql -h -d -U command line?

From: Joao Miguel Ferreira <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to set password in psql -h -d -U command line?
Date: 2022-04-28 09:42:21
Message-ID: CALyyT7SwLfFr8Z43zsgdLsmf72gqLkGcVQ0EL0hZCYpGw+8Y5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com>
wrote:

> I tried various ways to set password in psql command line, but got no luck.
>
> Can anyone help?
>
> Regards,
>
> David
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josha Inglis 2022-04-28 09:43:04 Re: How to set password in psql -h -d -U command line?
Previous Message Karsten Hilbert 2022-04-28 09:40:02 Aw: How to set password in psql -h -d -U command line?