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

From Haribabu Kommi
Subject Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types
Date
Msg-id CAJrrPGf2X3OviKA1Zot81eaFkViPicG12Gc-fOObsPhZbnwTEg@mail.gmail.com
Whole thread Raw
In response to Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types  (Michael Paquier <michael@paquier.xyz>)
Responses Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers

On Tue, Mar 27, 2018 at 12:23 AM, Michael Paquier <michael@paquier.xyz> wrote:
On Mon, Mar 26, 2018 at 11:39:51PM +1100, Haribabu Kommi wrote:
> And if we are not going to change the above, then PQhost() function
> returns 3 values,
> - NULL when the conn==NULL
> - Actual host or hostaddr of the active connection
> - Empty string when the conn is not able to evaluate.
>
> Is it fine to proceed like above?

Yeah, I would think that this is a sensible approach.  Keeping
consistent with NULL is good for the other function, and we still need a
way to identify the dont-know state.  Peter, what's your input on that?

Patch attached with the above behavior along with other comments from upthread.


Regards,
Hari Babu
Fujitsu Australia
Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ppc64le support in 9.3 branch?
Next
From: Nikolay Samokhvalov
Date:
Subject: Re: idea - custom menu