Re: Postgres in bash-mode - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Postgres in bash-mode
Date
Msg-id Pine.LNX.4.30.0201102341320.2937-100000@peter.localdomain
Whole thread Raw
In response to Postgres in bash-mode  (Alexander Pucher <pucher@atlas.gis.univie.ac.at>)
List pgsql-hackers
Alexander Pucher writes:

> In MySQL, I did it like this:
>
> 'mysql -u user -ppassword < script.sh'

Then you might as well not have any authentication at all, because every
user on your system can then read the password off the "ps" output.

> My problem is that I can't find a way to put the password in an 'psql'
> statement at the prompt.

You can put it into the environment variable PGPASSWORD, but that *might*
suffer from the same problems depending on your OS.  If you want real
noninteractive login you will have to use a different authentication
method, such as ident.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: "Rod Taylor"
Date:
Subject: Re: Postgres in bash-mode
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_upgrade