Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBeR0-0000Kj-AW for pgsql-general@arkaria.postgresql.org; Tue, 20 Jun 2023 16:42:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBeQx-0002yA-Qd for pgsql-general@arkaria.postgresql.org; Tue, 20 Jun 2023 16:42:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBeQx-0002y1-Ft for pgsql-general@lists.postgresql.org; Tue, 20 Jun 2023 16:42:23 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qBeQt-003es8-NS for pgsql-general@lists.postgresql.org; Tue, 20 Jun 2023 16:42:22 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id ED96069590; Tue, 20 Jun 2023 18:42:17 +0200 (CEST) Date: Tue, 20 Jun 2023 18:42:17 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Question: Multiple pg clusters on one server can be reached with the standard port. Message-ID: <20230620164217.rwdascyd52kgu774@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <0c2dd853-08ec-dbed-00c3-a680ae711d89@proventis.net> <71943c04e05c3c13d5cd2b287909f351@weiller.eu> <20230619103335.xyagd43uhneducxz@hjp.at> <0f467ff1-8cdb-2460-75d6-0e0e4497890f@gmail.com> <20230619171536.2kcrdor36rqchicq@hjp.at> <47751285-8c76-c31f-97a4-5c6e2e7db72e@gmail.com> <20230620145414.qjkdzctlja3z53u4@hjp.at> <7e738278-6384-e628-5fd2-8cfd4cdbb862@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vovhz2xij3vwjqhs" Content-Disposition: inline In-Reply-To: <7e738278-6384-e628-5fd2-8cfd4cdbb862@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --vovhz2xij3vwjqhs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023-06-20 10:10:47 -0500, Ron wrote: > On 6/20/23 09:54, Peter J. Holzer wrote: > > On 2023-06-19 16:09:34 -0500, Ron wrote: > > > On 6/19/23 12:15, Peter J. Holzer wrote: > > > On 2023-06-19 07:49:49 -0500, Ron wrote: > > > On 6/19/23 05:33, Peter J. Holzer wrote: > > > So (again, as Francisco already wrote) the best way is p= robably to write > > > a simple proxy which uses the database (not DNS) name fo= r routing. I > > > seem to remember that nginx has a plugin architecture fo= r protocols so > > > it might make sense to write that as an nginx plugin ins= tead of a > > > standalone server, but that's really a judgement call th= e programmer has > > > to make. Another possibility would of course be to exten= d pgbouncer to > > > do what the OP needs. > > >=20 > > > How would this work with JDBC clients? > > >=20 > > > Same as with any other client, I guess. Any reason why it should= be > > > different? > > >=20 > > >=20 > > > That goes to my ultimate point: why would this work, when the point o= f a > > > database client is to connect to a database instance on a specific po= rt like > > > 5432, not connect to a web server. > > Consider this scenario: > >=20 > > You have several databases scattered across several hosts and ports: > >=20 > > db1 host1.example.com:5432 > > db2 host1.example.com:5433 > > db3 host2.example.com:5432 > > db4 host3.example.com:5432 > >=20 > > Then you have your proxy/gateway/bouncer (whatever you want to call it) > > listening on proxy.example.com:5432. >=20 > Proxies/gateways are great. My question is about why you mentioned nginx. Somebody else mentioned nginx as a possible solution. I wrote that I don't think that nginx can do that out of the box but it might be possible to write a plugin/module. Personally. I wouldn't (learning how to write nginx modules almost certainly takes longer than writing a simple proxy from scratch), but if somebody is already familiar with nginx modules and/or has other reasons to use nginx ... hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --vovhz2xij3vwjqhs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmSR1uMACgkQ8g5IURL+ KF0v4A/8Csfsoz3dzOvYs2z3x+RFcgN0Ov3dDH6/lLUdUXqmZru4liaVCd7NZl8e GbnrqPmFeh8AKJcl9+dI6NkwO2AcM4/OQcIFQTX1+XG9nzqt3Il9f2jXz+upQBxg 23g6/BvqOxqAM+gZzbk2edZR+cBD0Zj1NAePsG297Zc+eb59YUqwwH7I6SVldvqX IBoxxtYoFwH8SsDv4btBR+rR6G1RN7ovap16FBsfuk1MdgOlUmDbftgkv20dPrXp UifMS7EykfpkgPgJ4Lw+xF3kqRkgQi5bl9cNKcJIdyarwkWi+aXZuR0XO2OSXLf8 ZmnrBkpydV+LGOAnDCprfDRCbvMsJubHBEfQKVExbmlFaWO1A2MVXpo4Sz4pRrXc mIKMKCL0PBwPIVRfMqsiL0O/Tr1L+2QZiyddgxvHIRndyea6yq+jMTgS95dXLVG3 oTnw5LZhjyERXytLpDslRDco0aH3EMJ728vOf2NKtQqTsiy8WZ1lLo5h54IgsUzg KKu4kUh77L9nkqg4OljIxx3fCYdBzmt6UicWD/DJy6T2dVa9VGKdYtVmObkB4RTe bqmHpWOJsHvoaQ1526/eVBOv5VvkLEtojf8yJlOiHsHI9HqLQQ5IE8Tw2iDO6Xt/ BdITAfqugxMlmiDcaKCrw7Q3bvo21NoaFKGNyPTJ6q93+7tQzRQ= =ld8H -----END PGP SIGNATURE----- --vovhz2xij3vwjqhs--