On Mon, Mar 17, 2008 at 7:34 PM, Martin Pitt <[EMAIL PROTECTED]> wrote:

> Mika Fischer [2008-03-17 10:19 +0000]:
> > Description:        psql should provide option to not prompt for
> password
> > Details:
> >
> > Hi,
> >
> > I'm currently working on the bash-completion package. The problem with
> > postgresql is that psql cannot safely be called because there is no way
> to
> > know whether it will prompt for a password and there is also no way to
> avoid
> > the prompt.
> >
> > Needless to say a password prompt is very bad in the context of
> > tab-completion.
> >
> > Ideally, psql should provide an option --no-password which would cause
> it to
> > never promt for a password, and in case one is needed, fail as if a
> wrong
> > one was given.
> >
> > However if you can think of an easier way to accomplish this, I'd be
> > grateful for pointers.
>
> Indeed I have a similar problem. I use psql to probe for actual
> availability of cluster startup in the integration scripts (pg_ctl
> does not provide that) and also stumbled over this.
>
> Earlier versions did not prompt if PGPASSWD was supplied, 8.3 changed
> this behaviour.


That should be PGPASSWORD

The 8.3 docs still mention it here:

http://www.postgresql.org/docs/8.3/interactive/libpq-envars.html

This applies to psql too, since psql uses libpq to communicate with the
server.

If you think that docs are out of sync, please raise a bug for that. Also,
there's a workaround mentioned there (~/.pgpass file), see if that helps.

Best regards,

-- 
[EMAIL PROTECTED]
[EMAIL PROTECTED] gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

17° 29' 34.37"N, 78° 30' 59.76"E - Hyderabad *
18° 32' 57.25"N, 73° 56' 25.42"E - Pune
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

Reply via email to