Skip site navigation (1) Skip section navigation (2)

Re: Do dropdb and createdb read password from .pgpass file?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Sankaran Anupama <sanupama(at)novell(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Do dropdb and createdb read password from .pgpass file?
Date: 2005-05-12 13:23:18
Message-ID: 20050512132317.GA28121@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Wed, May 11, 2005 at 11:35:16PM -0600, Sankaran Anupama wrote:
>
> I find that while pg_dump and pg_restore take/read the password from
> the .pgpass file, dropdb and createdb do not. For these, i'm still
> having to key in the password. The permissions for the .pgpass is 0600
> as expected.

Using .pgpass is a behavior of libpq, which underlies utilities
like pg_dump, createdb, and dropdb.  If createdb and dropdb are
linked against a libpq from PostgreSQL 7.3 or later, then they
should be using .pgpass.  Have you done a process trace or examined
the access time of .pgpass to test your hypothesis that createdb
and dropdb don't use it?  Have you used the --version option to
verify that the correct versions of those utilites are being used,
or ldd to see which libpq they're linked against?

createdb and dropdb make connections to template1.  Have you checked
pg_hba.conf to see if connecting to template1 is different than
connecting to other databases?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-bugs by date

Next:From: Michael BeckstetteDate: 2005-05-12 13:27:58
Subject: Re: Missing tables in postgresql 7.2.4
Previous:From: raphalaDate: 2005-05-12 08:57:12
Subject: Please help me

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group