Re: Serverside SNI support in libpq

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>, Michael Banck <mbanck@gmx.net>, Jacob Champion <jacob.champion@enterprisedb.com>, Jelte Fennema-Nio <postgres@jeltef.nl>, Heikki Linnakangas <hlinnaka@iki.fi>, "li.evan.chao" <li.evan.chao@gmail.com>, Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>, Pgsql Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-04T19:22:37Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Declare load_hosts() as returning HostsFileLoadResult.

Attachments

In preparation for our annual pgindent update, I checked what happens
when I install the buildfarm's version of typedefs.list, and I found
that the typedef HostsFileLoadResult (from 4f433025f) gets
misformatted because it's not in the buildfarm's list.  That's because
the buildfarm mechanism only captures typedefs that are used to
declare some object (variable, function, field) and this one isn't.

It seems quite odd to me that load_host(), which in fact returns
HostsFileLoadResult codes, is declared to return int.  That seems
to have been done because HostsFileLoadResult wasn't declared in
the same header, but there is no visible reason why it shouldn't be.
Any objection to the attached fixup?

As a side matter, "load_host" seems like a remarkably generic name
that conveys little about what it actually does, and to the extent
that it does convey anything the implication is wrong: it returns
(potentially) info about multiple hosts not just one.  Can't we do
better?

			regards, tom lane