Re: pg_getaddrinfo_all() with hintp=NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_getaddrinfo_all() with hintp=NULL
Date: 2025-11-13 00:17:36
Message-ID: 2476718.1762993056@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> 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.

We already reject null hints (by crashing), and have done for decades.
I don't think there's anything very wrong with the current code, and I
don't really see that the proposed patch is an improvement. If
anything, I'd just add a comment to pg_getaddrinfo_all saying that
unlike bare getaddrinfo, we require a valid hintp.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-11-13 00:32:12 Re: another autovacuum scheduling thread
Previous Message Fujii Masao 2025-11-12 23:54:10 Re: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.