Re: -d option for pg_isready is broken

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: -d option for pg_isready is broken
Дата
Msg-id CAHGQGwGCcWK4dTpRPtVEcJzubVTkArLKLBC7Q=QDNG4PaMxMng@mail.gmail.com
обсуждение исходный текст
Ответ на Re: -d option for pg_isready is broken  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Dec 12, 2013 at 4:48 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Wed, Dec 11, 2013 at 2:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> More generally, if we do go over in 9.4 to the position that PQhost
>>> reports the host parameter and nothing but, I'm not sure that introducing
>>> a third behavior into the back branches is something that anybody will
>>> thank us for.
>
>> It doesn't seem very plausible to say that we're just going to
>> redefine it that way, unless we're planning to bump the soversion.
>
> Well, we didn't bump the soversion (nor touch the documentation)
> in commit f6a756e4, which is basically what I'm suggesting we ought
> to revert.  It was nothing but a quick hack at the time, and hindsight
> is saying it was a bad idea.  Admittedly, it was long enough ago that
> there might be some grandfather status attached to the current behavior;
> but that argument can't be made for changing its behavior still further.
>
>> But maybe we should decide what we *are* going to do in master first,
>> before deciding what to back-patch.
>
> Right.

I'm thinking to implement PQhostaddr() libpq function which returns the
host address of the connection. Also I'd like to fix the following two bugs
of PQhost(), which I reported upthread.

> (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.

Then, we can change \conninfo so that it calls both PQhostaddr() and
PQhost(). If PQhostaddr() returns non-NULL, \conninfo should display
the IP address. Otherwise, \conninfo should display the return value of
PQhost().

Regards,

-- 
Fujii Masao



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: ALTER SYSTEM SET command to change postgresql.conf parameters
Следующее
От: Sawada Masahiko
Дата:
Сообщение: Re: Logging WAL when updating hintbit