Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types
Date: 2018-03-26 13:23:50
Message-ID: 20180326132350.GG2759@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2018-03-26 13:42:08 Re: Re: WIP: Covering + unique indexes.
Previous Message Stephen Frost 2018-03-26 13:20:09 Re: Parallel Aggregates for string_agg and array_agg