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 1qBd0P-0004Ss-Vg for pgsql-general@arkaria.postgresql.org; Tue, 20 Jun 2023 15:10:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBd0O-0008Ie-TN for pgsql-general@arkaria.postgresql.org; Tue, 20 Jun 2023 15:10:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBd0O-0008I7-JC for pgsql-general@lists.postgresql.org; Tue, 20 Jun 2023 15:10:52 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBd0L-003GII-EK for pgsql-general@lists.postgresql.org; Tue, 20 Jun 2023 15:10:51 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-bc4f89f0f2fso4875813276.3 for ; Tue, 20 Jun 2023 08:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687273848; x=1689865848; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=69BgHjLoFQPnEKFNnamrzf81UlrRCG2QP5OZ2Dq2Gxc=; b=WtJ+Pdt1LxhLOmxlh7aAVxw9tCPi+3Pl55mgl2po2ec7CV8Kc0eMBV+VJ94B3+bjz8 upj0fMScJ7UfNYdDE0we5fBMaMN81wW0NHPvp/sMUqFRojR/TbQNAa39HQYsBrFM/6kZ 0GXQmaAqLi/XwooYf/xvsneumO3cCIOxkG3uylFJJwlLWrOyOx3JuxOhEFRMlCWvWTHE Hec5hl4OA60hxNz9ay/4gml4x9i0+sMEx0BKa43JlixkaO1tDp1STGbi169IDGxFe5qN MLNde0e/hLC/8VHhlrekNmIoaLtTqs+EwVgQKxn9PbO7kuioSpGLLvCWg2EtDjRMdcUO H3/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687273848; x=1689865848; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=69BgHjLoFQPnEKFNnamrzf81UlrRCG2QP5OZ2Dq2Gxc=; b=GR4oHtl1mg2zA3hJNcomZQx9tj3V2y036JFTXqYTgMr4AOAbROblKnXoHcM4WnLFHv cKE+yiju0VDLeR6ET8QntQcy+w1KwjKFf8/dg1OoCxGFKVMRZxTCFmMCc3mvteC8NxQj NvP9ODoG1j+7CmAbwe7fpoqOeehgrcZzXYAmKKSUkEkaHWnxj9tCtcuRUTMQvXvYmKKK wjGuNsxrcNEWguXcO3EIsqnSg5r6ZIaFxcq3y9hklQnRL2MPdbstk91TTMHphqqknZr8 DlC6PnXxJX5WOXg8g6BOvD4VneNVlOE80bUPB9PxF1ZhMbJvBGwAyUzvFhmfaLNU+UUE x+aQ== X-Gm-Message-State: AC+VfDyCAb9ThHHfH1wiMCiVJqdbV9Cow44B/yR6IvmIZg0/9DxLFylz dmM+iXmKsz79fcyClTH/WnU2JieodY0= X-Google-Smtp-Source: ACHHUZ4sf7rjhDseq+37osFodU0/uLZRFzhjTeq8YTiO5kR7z5Hy18RT5SZhKhVzr7UujeINS2iXkw== X-Received: by 2002:a05:6902:c5:b0:bca:d7e8:71cb with SMTP id i5-20020a05690200c500b00bcad7e871cbmr8363664ybs.33.1687273848442; Tue, 20 Jun 2023 08:10:48 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:25cb:dc10:e537:7cd1? ([2600:1700:bd2c:b810:25cb:dc10:e537:7cd1]) by smtp.googlemail.com with ESMTPSA id f81-20020a25cf54000000b00bcc0f2e4f05sm405104ybg.59.2023.06.20.08.10.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jun 2023 08:10:48 -0700 (PDT) Message-ID: <7e738278-6384-e628-5fd2-8cfd4cdbb862@gmail.com> Date: Tue, 20 Jun 2023 10:10:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Question: Multiple pg clusters on one server can be reached with the standard port. Content-Language: en-US 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> From: Ron In-Reply-To: <20230620145414.qjkdzctlja3z53u4@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 probably to write >> a simple proxy which uses the database (not DNS) name for routing. I >> seem to remember that nginx has a plugin architecture for protocols so >> it might make sense to write that as an nginx plugin instead of a >> standalone server, but that's really a judgement call the programmer has >> to make. Another possibility would of course be to extend pgbouncer to >> do what the OP needs. >> >> How would this work with JDBC clients? >> >> Same as with any other client, I guess. Any reason why it should be >> different? >> >> >> That goes to my ultimate point: why would this work, when the point of a >> database client is to connect to a database instance on a specific port like >> 5432, not connect to a web server. > Consider this scenario: > > You have several databases scattered across several hosts and ports: > > db1 host1.example.com:5432 > db2 host1.example.com:5433 > db3 host2.example.com:5432 > db4 host3.example.com:5432 > > Then you have your proxy/gateway/bouncer (whatever you want to call it) > listening on proxy.example.com:5432. Proxies/gateways are great. My question is about why you mentioned nginx. -- Born in Arizona, moved to Babylonia.