Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzR7q-0040te-1A for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 03:50:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzR7p-00HJ25-15 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 03:50:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzR7p-00HJ1x-01 for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 03:50:01 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wzR7m-00000001TzD-3CqL for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 03:50:00 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-39686abd426so1455675a91.1 for ; Wed, 26 Aug 2026 20:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787802596; x=1788407396; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:content-type :message-id:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hEE0dxYBH0sJebYWy3h/dKZHdBYjQsbbdXFFb8stahc=; b=pJFNXjQr8K1vm9hRoMWdj4rQ2BfIiXXvGduMgFV/HoYOL6txrPqu2WYZoH5dtRBJ2y 9McI62oST429TQmOwOy6GNRNZV3ujNQsFJPEVOMOzemsDxnNiVEEpM8CoATBkFvz8MXy 41pKfhf1SVL1qzCY3j69tPGHS8vrX9/mpKT7BP8TvNvj7cpe9fgquUpgnLBBv0tsHSk4 TK5/oWXBVKrTWa+q9ZZ/zCDZjazTJbWpYP88pcv0efZBwrEVSkssAp5YtC9Yum0pwspA mmoZjIrE9lbJsh+H/i/N1dZ+TebXcivZvoLtlZAtsXw6TGvssfqBrmIiJmPeXmIR4S9x 7x6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787802596; x=1788407396; h=references:to:cc:in-reply-to:date:subject:mime-version:content-type :message-id:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hEE0dxYBH0sJebYWy3h/dKZHdBYjQsbbdXFFb8stahc=; b=X/XXH+tl5TP6ntewxngmu1YrYW32VFlqpWFRqQgqM2FQ5j/3rqvgCwVxz8rqApJFa4 Zm1+gViekXn5qJFxmnczvu3VKjJa2z/Xmn4qrieZ09f1ZEgetzcWmsMwc5frIDLKBCg2 7R6CqHthRKnxigW+kRK71jTGNWyhVRofjUsVKNzJ+eT6PgRdgpxfoLeschdn48eQrwG2 yipduEHWaZDzco1JpxFGrsI7ymMbHXuFl9FmIRSPgPHpFTabNPwUD+lZ1K1Ch4HDfnB1 SxrF6ZQhSWEEUgk+Zv8O3qN2MAIEDxuUMMyvA/DTqB+VcgPK8zfYZwvt5qa6YuyBgPAw P7hg== X-Gm-Message-State: AFuF++lx76Mkir1W8kcL2oFIyDMp2FwKaxKa5R0CeGnhx1STlayp7PND eh+Fs01d9nYnkAW250XBvH9GGYAXCHHQJpqZRolZTB5opnLdCjzQASgPvdVEMA== X-Gm-Gg: AR+sD122sC22j3SOtM3nC1mM9fT8ii+W+vUMxrz4WJoisknz95jn273p5857an5DOMP IwGUgw+7+tRYEjQy3DdCb1CQjIVg3LvLwbj+49arAFDydmG8TJztFs7fO6Scq4CMcUsu/pCDJv3 GU1R/l5uFwMYbAKL6a+IO+s80hcdVMnp134/cIi4qbHV3A0L9IZkELHjAGDtPLKnweGnEK2TZPA xUWEzIclWap9zUQeYkPmZfpDNaO/6aSG4ztB/r3TS7zeP/LuNWrfEz3+l+AMsGNM689MeSs/1Pk irPgVN9p2Kc+o7IdTVqRElhg8W7awG0mZNH1/ZXLh0X2YH3bdrzH2GUdGKoh5Npuy66Ce99mYtq l4Eed1SrOXcjTjwWGl5UuFmuxFPA04eRuThQASlnn4+PUKYF+jJYen0E3yCkEV9nkXhsE24y+z/ qb1BlmHufZ5jpKoZuTgFQq6gcmng7n+CpjtEpT4mZrClkwCU69PbWoO33W4ah06aZjCU6hBjRfO JLY8cxrppg/VlT9wzsGiWAPZ5gypnuuHGpxbWlOfnDA0BUYDSvLuXnWMQI= X-Received: by 2002:a17:90b:1d46:b0:396:5fce:8e24 with SMTP id 98e67ed59e1d1-3966d197b6dmr25954284a91.4.1787802596116; Wed, 26 Aug 2026 20:49:56 -0700 (PDT) Received: from smtpclient.apple (mx-ll-171.5.165-154.dynamic.3bb.co.th. [171.5.165.154]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-396b1123142sm907701a91.15.2026.08.26.20.49.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2026 20:49:55 -0700 (PDT) From: Denis Smirnov Message-Id: <71685CE0-477D-4E4B-ADFE-D3CC3873512C@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_841D7C73-8503-4914-BA6B-FE72B7B60919" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [Proposal] add portaddr like hostaddr Date: Thu, 27 Aug 2026 10:49:42 +0700 In-Reply-To: Cc: pgsql-hackers@lists.postgresql.org To: Diego References: <70436540-9d77-4014-89af-462881ed18d9@gmail.com> <1e3b609e-4cf7-4c39-8770-8248c8b81399@gmail.com> <63F7ADE6-DF8F-4261-9FEC-89A381E57E6A@gmail.com> X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_841D7C73-8503-4914-BA6B-FE72B7B60919 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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 --Apple-Mail=_841D7C73-8503-4914-BA6B-FE72B7B60919 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
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

= --Apple-Mail=_841D7C73-8503-4914-BA6B-FE72B7B60919--