On Thu, Dec 12, 2013 at 4:48 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Robert Haas <robertmh...@gmail.com> writes: >> On Wed, Dec 11, 2013 at 2:29 PM, Tom Lane <t...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers