Re: pg_getaddrinfo_all() with hintp=NULL - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: pg_getaddrinfo_all() with hintp=NULL
Date
Msg-id 7B7A08AB-7B09-4940-80A2-8AFBA402DA4B@yesql.se
Whole thread Raw
In response to Re: pg_getaddrinfo_all() with hintp=NULL  (Sergey Tatarintsev <s.tatarintsev@postgrespro.ru>)
Responses Re: pg_getaddrinfo_all() with hintp=NULL
List pgsql-hackers
> On 12 Nov 2025, at 09:46, Sergey Tatarintsev <s.tatarintsev@postgrespro.ru> wrote:

> I added a comment to pg_freeaddrinfo_all.
> I don't think it made sense to comment that hint_ai_family simply shouldn't be equal to AF_UNIX,
> so I specified that if the original hints were NULL, hint_ai_family should be equal to AF_UNSPEC.

Agreed.

It's still not clear to ne that we should make pg_getaddr_info() mimic the API
of getaddrinfo since it's not a thin wrapper over getaddrinfo.  The alternative
option would be to return EAI_FAIL on a null hint and force the caller to
provide an AF_UNSPEC if that is what is indeed asked for.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Extended test coverage and docs for SSL passphrase commands
Next
From: Jeremy Schneider
Date:
Subject: Re: another autovacuum scheduling thread