Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types
Date
Msg-id 20180327043200.GA9940@paquier.xyz
Whole thread Raw
In response to Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Mon, Mar 26, 2018 at 09:03:17PM -0700, David G. Johnston wrote:
> And yes, while I'm not sure right now what the multi-value condition logic
> results in it should be mentioned - at least if the goal of the docs is to
> be a sufficient resource for using these functions.  In particular what
> happens when the connection is inactive (unless that falls under "cannot be
> evaluated"...).

Yes, the fast that it is not possible to rely on the return value for
multiple hosts as long as the connection is not sanely established needs
to be documented anyway.  For example if a client uses PQconnectStart()
for an asynchronous start then connhost is initialized with whichhost
set to 0, so PQhost won't return an empty string.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: ON CONFLICT DO UPDATE for partitioned tables
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] why not parallel seq scan for slow functions