From: Denis Smirnov <darthunix@gmail.com>
To: Diego <mrstephenamell@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [Proposal] add portaddr like hostaddr
Date: Thu, 27 Aug 2026 10:49:42 +0700
Message-ID: <71685CE0-477D-4E4B-ADFE-D3CC3873512C@gmail.com> (raw)
In-Reply-To: <ee1051ac-a37e-4f97-901b-fa4dc96400d9@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>
Hi Diego,
I agree that this is a client-side issue and that libpq is a client
library. But that does not mean libpq should model the whole route to
the server.
A route can contain several SSH hops, proxies, and poolers:
libpq -> localhost:39907 -> SSH jump1 -> SSH jump2
-> PgBouncer:6432 -> PostgreSQL:5432
It is not clear why libpq should expose exactly two endpoints. Which
port is the "server port" here: 39907, 6432, or 5432? Only 39907 is
visible to libpq.
I think libpq should keep one connection endpoint, as it does today.
port and PQport() should continue to mean the port to which libpq
actually connects.
SSH forwarding should be configured by SSH itself, for example with
ProxyJump and LocalForward in ~/.ssh/config. If an application creates
a tunnel, it should manage that mapping itself. Pooler routing should
likewise remain in the pooler configuration.
For these reasons, I do not think portaddr belongs in libpq.
Best regards,
Denis Smirnov
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: darthunix@gmail.com, mrstephenamell@gmail.com
Subject: Re: [Proposal] add portaddr like hostaddr
In-Reply-To: <71685CE0-477D-4E4B-ADFE-D3CC3873512C@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>
* 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