Re: Postgres in bash-mode

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alexander Pucher <pucher(at)atlas(dot)gis(dot)univie(dot)ac(dot)at>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postgres in bash-mode
Date: 2002-01-11 04:43:41
Message-ID: Pine.LNX.4.30.0201102341320.2937-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-01-11 05:19:27 Re: pg_upgrade
Previous Message Rod Taylor 2002-01-11 04:31:23 Re: Postgres in bash-mode