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

Re: [HACKERS] PGPASSWORD and client tools

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] PGPASSWORD and client tools
Date: 2004-10-05 22:09:53
Message-ID: 41631BB1.7070009@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Here's a patch that I think (hope) does this right, by using the file 
pointed to by the environment var PGPASSFILE, if set, in preference to 
$HOME/.pgpass. I assume that at this stage it would be held over for 8.1 
as a new feature - if not I'll put together some docco in a hurry.

cheers

andrew



Andrew Dunstan wrote:

>
>
> Tom Lane wrote:
>
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>  
>>
>>> How about an environment variable that points to a .pgpass type file.
>>>   
>>
>>
>> You can do that today: point $HOME at some temp directory or other.
>> AFAIR pg_dump doesn't make any other use of $HOME ...
>>
>>  
>>
>>> Or we could even play games with PGPASSWORD - if it names an 
>>> existing file that satisfies the .pgpass criteria then it will be 
>>> taken as the location of the .pgpass file instead of $HOME/.pgpass - 
>>> otherwise its value will be considered to be the password itself.
>>>   
>>
>>
>> Gaack... if you want a separate variable, we can talk about that, but
>> let's not overload PGPASSWORD like that.  Consider even just the
>> implications of whether libpq error messages should echo back the
>> "filename" ...
>>
>>
>>  
>>
>
> Yeah. as usual you're right :-)
>
> So let's go woth PGPASSFILE
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

Attachment: passfile_env.patch
Description: text/x-patch (2.7 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Abhijit Menon-SenDate: 2004-10-05 23:55:02
Subject: Re: libpq and prepared statements progress for 8.0
Previous:From: Tom LaneDate: 2004-10-05 21:48:27
Subject: Re: libpq and prepared statements progress for 8.0

pgsql-patches by date

Next:From: Luiz K. MatsumuraDate: 2004-10-05 23:13:47
Subject: pg_dumpall bug in PG 8.0b3 Win32 port
Previous:From: Tom LaneDate: 2004-10-05 21:48:27
Subject: Re: libpq and prepared statements progress for 8.0

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