Re: -d option for pg_isready is broken - Mailing list pgsql-hackers

From Robert Haas
Subject Re: -d option for pg_isready is broken
Date
Msg-id CA+TgmoYDwQ6L7q9Jjz=kdBrR0TNUac_paKnWZh8hMx4NvnqSeA@mail.gmail.com
Whole thread Raw
In response to Re: -d option for pg_isready is broken  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: -d option for pg_isready is broken
List pgsql-hackers
On Tue, Dec 10, 2013 at 11:40 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> While I was investigaing PQhost() for that approach, I found several
> problems of PQhost().
>
> (1) PQhost() can return Unix-domain socket directory path even in the
> platform that
>     doesn't support Unix-domain socket.
>
> (2) In the platform that doesn't support Unix-domain socket, when
> neither host nor hostaddr
>     are specified, the default host 'localhost' is used to connect to
> the server and
>     PQhost() must return that, but it doesn't.

I think changing PQhost() so that it returns DefaultHost rather than
conn->pgunixsocket when we don't HAVE_UNIX_SOCKETS is a back-patchable
bug fix, and I'd say go for it.

> (3) PQhost() cannot return the hostaddr.

However, I'm much less sure whether this is something that we want to
do at all.  It seems like this might be a definition of what the
function does, and I'm not sure whether the new definition is what
everyone will want.  On the other hand, I'm also not sure that it
isn't.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Euler Taveira
Date:
Subject: Re: should we add a XLogRecPtr/LSN SQL type?
Next
From: Fujii Masao
Date:
Subject: Re: -d option for pg_isready is broken