Re: [HACKERS] Redefine default result from PQhost()?

2015-11-27 Thread Noah Misch
On Thu, Nov 26, 2015 at 10:48:50AM -0500, Tom Lane wrote: > Magnus Hagander writes: > > On Wed, Nov 25, 2015 at 11:59 PM, Tom Lane wrote: > >> I think we should [ return DEFAULT_PGSOCKET_DIR not NULL ] > > > I agree with this change in genera. But I

Re: [HACKERS] Redefine default result from PQhost()?

2015-11-27 Thread Tom Lane
Magnus Hagander writes: > Hmm. Good point. I didn't realize they already had to be ready to get a > non-default path back. Yeah, if it weren't for that, this would definitely be a hazardous change. But AFAICS, an app that has a problem with this proposal was broken already,

Re: [HACKERS] Redefine default result from PQhost()?

2015-11-27 Thread Magnus Hagander
On Thu, Nov 26, 2015 at 4:48 PM, Tom Lane wrote: > Magnus Hagander writes: > > On Wed, Nov 25, 2015 at 11:59 PM, Tom Lane wrote: > >> I think we should [ return DEFAULT_PGSOCKET_DIR not NULL ] > > > I agree with this change in

Re: [HACKERS] Redefine default result from PQhost()?

2015-11-26 Thread Magnus Hagander
On Wed, Nov 25, 2015 at 11:59 PM, Tom Lane wrote: > Currently, libpq's PQhost() function will return NULL if the connection is > using the default Unix-socket connection address. This seems like a > pretty dubious definition to me. psql works around it in several places >

Re: [HACKERS] Redefine default result from PQhost()?

2015-11-26 Thread Tom Lane
Magnus Hagander writes: > On Wed, Nov 25, 2015 at 11:59 PM, Tom Lane wrote: >> I think we should [ return DEFAULT_PGSOCKET_DIR not NULL ] > I agree with this change in genera. But I wonder if there's a risk here > that we break some applications isnt'

[HACKERS] Redefine default result from PQhost()?

2015-11-25 Thread Tom Lane
Currently, libpq's PQhost() function will return NULL if the connection is using the default Unix-socket connection address. This seems like a pretty dubious definition to me. psql works around it in several places with host = PQhost(pset.db); if (host == NULL)