Re: [Proposal] add portaddr like hostaddr - Mailing list pgsql-hackers

From Denis Smirnov
Subject Re: [Proposal] add portaddr like hostaddr
Date
Msg-id 71685CE0-477D-4E4B-ADFE-D3CC3873512C@gmail.com
Whole thread
In response to Re: [Proposal] add portaddr like hostaddr  (Diego <mrstephenamell@gmail.com>)
Responses Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: tablecmds: fix bug where index rebuild loses replica identity on partitions
Next
From: Chao Li
Date:
Subject: Re: pg_upgrade silently truncates nextMultiOffset to 32 bits