Unix Technical Forum

.pgpass file and unix domain sockets

This is a discussion on .pgpass file and unix domain sockets within the Pgsql Patches forums, part of the PostgreSQL category; --> Since no decision has been reached in http://archives.postgresql.org/pgsql...5/msg00295.php I send in the appended documentation patch to fix at least ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:38 AM
Joachim Wieland
 
Posts: n/a
Default .pgpass file and unix domain sockets

Since no decision has been reached in

http://archives.postgresql.org/pgsql...5/msg00295.php

I send in the appended documentation patch to fix at least the
documentation. Personally I think that there is no need to invent a new
syntax since we can express everything already with the current one.


Joachim



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:38 AM
Tom Lane
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

Joachim Wieland <joe@mcknight.de> writes:
> I send in the appended documentation patch to fix at least the
> documentation.


This is wrong according to my tests. "localhost" *does* work,
at least in some cases.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:38 AM
Andrew Dunstan
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

Tom Lane wrote:
> Joachim Wieland <joe@mcknight.de> writes:
>
>> I send in the appended documentation patch to fix at least the
>> documentation.
>>

>
> This is wrong according to my tests. "localhost" *does* work,
> at least in some cases.
>
>


As I understand it, the only case where it doesn't is where an explicit
host connection parameter pointing to the socket directory, or the same
via PGHOST, is used, Is that right?

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:38 AM
Tom Lane
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> This is wrong according to my tests. "localhost" *does* work,
>> at least in some cases.


> As I understand it, the only case where it doesn't is where an explicit
> host connection parameter pointing to the socket directory, or the same
> via PGHOST, is used, Is that right?


Well, the point is that if you do that then you have to write that
socket directory as the hostname in .pgpass. What was on the table for
discussion was whether we like that behavior as-is (in which case we'd
better document it), or whether we should make it match "localhost" in
all cases, or whether we should do some third thing.

Personally I wouldn't object to making it match "localhost" in all
cases. That's what the documentation says, and the use-case for
doing something more complicated seems pretty thin.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:38 AM
Andrew Dunstan
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>> Tom Lane wrote:
>>
>>> This is wrong according to my tests. "localhost" *does* work,
>>> at least in some cases.
>>>

>
>
>> As I understand it, the only case where it doesn't is where an explicit
>> host connection parameter pointing to the socket directory, or the same
>> via PGHOST, is used, Is that right?
>>

>
> Well, the point is that if you do that then you have to write that
> socket directory as the hostname in .pgpass. What was on the table for
> discussion was whether we like that behavior as-is (in which case we'd
> better document it), or whether we should make it match "localhost" in
> all cases, or whether we should do some third thing.
>
> Personally I wouldn't object to making it match "localhost" in all
> cases. That's what the documentation says, and the use-case for
> doing something more complicated seems pretty thin.
>
>
>


I almost agree. If anything, I'd prefer to provide for an explicit entry
covering all Unix Domain sockets - it took me by some surprise to find a
while back that "localhost" covers that case - it seems a mismatch with
how pg_hba.conf works.

cheers

andrew


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 12:38 AM
Tom Lane
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> Personally I wouldn't object to making it match "localhost" in all
>> cases. That's what the documentation says, and the use-case for
>> doing something more complicated seems pretty thin.


> I almost agree. If anything, I'd prefer to provide for an explicit entry
> covering all Unix Domain sockets - it took me by some surprise to find a
> while back that "localhost" covers that case - it seems a mismatch with
> how pg_hba.conf works.


Well, that'd break existing .pgpass files (unless we match localhost
too, which seems to defeat the purpose). But maybe it's worth doing
for consistency's sake. I think we should bring it up on a more
widely read list than -patches if you want to propose a
non-backwards-compatible change ...

regards, tom lane

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:38 AM
Joachim Wieland
 
Posts: n/a
Default Re: .pgpass file and unix domain sockets

On Tue, May 16, 2006 at 09:43:42AM -0400, Tom Lane wrote:
> Joachim Wieland <joe@mcknight.de> writes:
> > I send in the appended documentation patch to fix at least the
> > documentation.


> This is wrong according to my tests. "localhost" *does* work,
> at least in some cases.


I see the problem now... I got confused by the debian package. There, psql
is a wrapper that explicitly sets environment variables including
PGHOST and then calls `the real' psql...

So you're clearly right, the problem is less severe than I thought. Sorry
for the noise.


Joachim


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:10 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com