dbTalk Databases Forums  

Re: [BUGS] Do dropdb and createdb read password from .pgpass

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] Do dropdb and createdb read password from .pgpass in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sankaran Anupama
 
Posts: n/a

Default Re: [BUGS] Do dropdb and createdb read password from .pgpass - 05-12-2005 , 09:26 AM






Thanks for the response.

The following are versions I checked:

postgres, createdb, dropdb, pg_dump and pg_restore - 7.4.7

I did an ldd for each of createdb, dropdb, pg_dump and pg_restore. The
output was - /usr/lib/libpq.so.3 for all of them.

All these have been linked with the same libpq library. So, thinking
wht could be the problem?

-Anu

Quote:
Michael Fuhr <mike (AT) fuhr (DOT) org> 05/12/05 6:53 PM
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/

---------------------------(end of
broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Do dropdb and createdb read password from .pgpass - 05-12-2005 , 11:28 AM






"Sankaran Anupama" <sanupama (AT) novell (DOT) com> writes:
Quote:
Thanks for the response.
The following are versions I checked:
postgres, createdb, dropdb, pg_dump and pg_restore - 7.4.7
I just tried it here, and 7.4.8 createdb definitely picks up .pgpass
for me. It seems like you must have some local breakage, but I'm not
sure what ... we've eliminated the obvious ideas.

Did you build these programs from source? If not, where'd you get them?
What's the platform exactly?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.