Re: The .pgpass file - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: The .pgpass file
Date
Msg-id 20071107184150.GC21788@alvh.no-ip.org
Whole thread Raw
In response to The .pgpass file  (Tommy Flewwelling <tommyflewwelling@hotmail.com>)
List pgsql-general
Tommy Flewwelling wrote:
>
> Hello,
>
> How do I specify in the command-line to access the .pgpass file when
> creating a database?

You don't.  If the file exists and has the correct permission, createdb
will read it.  If the needed password is found, the connection will be
done without ever prompting the user.

FWIW the -W switch is useless.  If createdb finds that the password is
needed, it will prompt the user even if -W is not specified.  If
createdb finds that the password is not needed, then it won't prompt the
user.

(Note that none of this is actually createdb's feature.  It is all done
by libpq internally.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Npsql is much faster than ODBC ?
Next
From: Gregory Stark
Date:
Subject: Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?