From: Diego <mrstephenamell@gmail.com>
To: Jacob Champion <jacob.champion@enterprisedb.com>
To: Denis Smirnov <darthunix@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [Proposal] add portaddr like hostaddr
Date: Fri, 28 Aug 2026 14:48:44 -0300
Message-ID: <92e93ea7-0c09-4fb2-b6ce-4f43cf444ebb@gmail.com> (raw)
In-Reply-To: <CAOYmi+n7n9rnOzzcH4wzVpg7Ac6zqCx_RrYSOiw-qYBMiv_2sA@mail.gmail.com>
References: <70436540-9d77-4014-89af-462881ed18d9@gmail.com>
<1e3b609e-4cf7-4c39-8770-8248c8b81399@gmail.com>
<63F7ADE6-DF8F-4261-9FEC-89A381E57E6A@gmail.com>
<ee1051ac-a37e-4f97-901b-fa4dc96400d9@gmail.com>
<71685CE0-477D-4E4B-ADFE-D3CC3873512C@gmail.com>
<636a2d5b-adaf-45d7-a255-870682a8cc73@gmail.com>
<CAOYmi+n7n9rnOzzcH4wzVpg7Ac6zqCx_RrYSOiw-qYBMiv_2sA@mail.gmail.com>
Hi Denis / Jacob!
Thank you both for the time you put into this, including reading the
pgcli code.
> I think Denis has this right. You're misinterpreting what host and
> hostaddr "mean", in a broader sense, and so the suggested split of
> port/portaddr is drawing a parallel where none exists.
Point taken. Spelling out what convinced me: when hostaddr is present,
host keeps real name-based duties, TLS server name and certificate
check, GSSAPI principal. The port coordinate has no counterpart for
any of those; the only consumer of a "logical port" would have been the
passfile lookup. That is too little to hang a host/hostaddr-style
split on, so I'm dropping portaddr and withdrawing the CommitFest
entry.
> Maybe there are good features that would help the UX for a local SSH
> tunnel, but I don't get the sense that this is one.
May I take you up on that? The residual case is a tunnel on a dynamic
local port: no passfile line can be written in advance, and a client
that wants to keep .pgpass working today has to reimplement the
passfile parser on its side. The first version of this proposal [1]
was a narrowly scoped, lookup-only knob (passfileport): it only changes
the port used in the passfile lookup, and claims nothing about
identity, PQport(), or the socket. Is that a shape worth refining, or
do you see this whole thing as belonging client-side, full stop?
Independently of that, I would like to send a small doc patch for the
pgpass section documenting the workaround that exists today (host +
hostaddr, fixed local port written into .pgpass); the same confusion
keeps resurfacing in client issue trackers.
[1] https://postgr.es/m/c0dfc226-9fbd-450b-a470-00f5427077a4@gmail.com
Thank you,
BR,
Diego
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: mrstephenamell@gmail.com, jacob.champion@enterprisedb.com, darthunix@gmail.com
Subject: Re: [Proposal] add portaddr like hostaddr
In-Reply-To: <92e93ea7-0c09-4fb2-b6ce-4f43cf444ebb@gmail.com>
References: <70436540-9d77-4014-89af-462881ed18d9@gmail.com> <1e3b609e-4cf7-4c39-8770-8248c8b81399@gmail.com> <63F7ADE6-DF8F-4261-9FEC-89A381E57E6A@gmail.com> <ee1051ac-a37e-4f97-901b-fa4dc96400d9@gmail.com> <71685CE0-477D-4E4B-ADFE-D3CC3873512C@gmail.com> <636a2d5b-adaf-45d7-a255-870682a8cc73@gmail.com> <CAOYmi+n7n9rnOzzcH4wzVpg7Ac6zqCx_RrYSOiw-qYBMiv_2sA@mail.gmail.com> <92e93ea7-0c09-4fb2-b6ce-4f43cf444ebb@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox