Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1zEu-0007FX-9z for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 20:03:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1zEs-0004Pg-UY for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 20:03:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1zEs-0004PZ-3v for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2019 20:03:34 +0000 Received: from resqmta-ch2-07v.sys.comcast.net ([2001:558:fe21:29:69:252:207:39]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1zEp-0004Jn-FN for pgsql-general@postgresql.org; Thu, 07 Mar 2019 20:03:32 +0000 Received: from resomta-ch2-14v.sys.comcast.net ([69.252.207.110]) by resqmta-ch2-07v.sys.comcast.net with ESMTP id 1vyZh1xkha3Pm1zEnhg1qc; Thu, 07 Mar 2019 20:03:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1551989009; bh=8XIAvqWRYaa8mG4T4VONc52raJJZU2zf4uRd9iDeKwU=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=DzjaT9cmUH2SPlyQDFdJKNLFr0VDQIhYUnuK/IqsBaX7MZZb7qJPEu30pYLDTJLqj w0eT9DY7fmUTCkrmGkiGkFyg8UQPd/m8X3s+lddCU5oUlzOIcLg7YOZC7TZTxCatEM yW7h5NcJWOxbgJ6ExHarcm4k3naK+AihkCcdH4XEJuBN40YmjuCcsHkFbiTXMVzY0x Pri+sKrsres0c99uGt+Deu3OYT7NG/2XlfjnvQncEDQprC9yk7hfeLBNvzD32rIaat ox5je/JAppJRHIQoj/LNdL0IVkjlyZVxWSN49474qz+C+dgZ0baoPU9GUvW1KhRVeU Kui21u/+HOYNw== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-14v.sys.comcast.net with ESMTPA id 1zEehBavZqwAo1zEeh9Ril; Thu, 07 Mar 2019 20:03:26 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedutddrfeekgddufeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkfgfgggtgfesthhqredttderjeenucfhrhhomheplfgvrhhrhicuufhivghvvghrshcuoehgshhivghvvghrshduleestghomhgtrghsthdrnhgvtheqnecuffhomhgrihhnpegtohhmphgrnhihrdgtohhmnecukfhppeduvddrudekjedrudduiedrudefvdenucfrrghrrghmpehhvghlohepjhhsihgvvhgvrhhsrdgtohhmtggrshhtrdhnvghtpdhinhgvthepuddvrddukeejrdduudeirddufedvpdhmrghilhhfrhhomhepghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtpdhrtghpthhtoheprhgrnhgruggvsehnohgurghlvgigtghhrghnghgvrdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=-100;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 6BC84260056; Thu, 7 Mar 2019 14:03:20 -0600 (CST) From: Jerry Sievers To: Arjun Ranade Cc: pgsql-general@postgresql.org Subject: Re: Connection pooling for differing databases? References: Date: Thu, 07 Mar 2019 14:03:20 -0600 In-Reply-To: (Arjun Ranade's message of "Thu, 7 Mar 2019 14:27:43 -0500") Message-ID: <87h8ce5u5z.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arjun Ranade writes: > Hi all, > > I'm wondering if there's a tool like pgpool that can provide a single > origin point (host/port) that will proxy/direct connections to the > specific servers that contain the db needing to be accessed. > > For example... lets say we had two databases: db1.company.com:5432 > and db2.company.com:5433 > > Db1 has the database: env1 > Db2 has the database: env2 > > Is there a tool that will accept connections, so that when users > connect they see there are two databases they can go to: env1 and > env2.=C2=A0 No, not at least the "they can see 2 DBs" portion of your req. PgBouncer can route traffic on behalf of multiple server/DBs by configuration but AFAIK even administrator access to the special endpoint 'pgbouncer' does *not* list all possible DBs unless they are in use and/or recently enough used to be still shown by 'show databases'. Direct consultation of the INI file would be required... ergo, there is nothing equivalent to psql -l. Disclaimer: I do *not* have recent experience with PgPool as-if to weigh-in there, but likely someone else will. HTH > > If they choose to connect to the env1 db, it routes all traffic to=20 > db1.company.com:5432 and if they choose env2 it routes them to=20 > db2.company.com:5433 > > Of course there would have to be some requirement such as the > databases on any given server cannot have name collisions with > database names on another server, etc.=C2=A0 Is there a way to do > something like this? > > Thanks, > Arjun > > --=20 Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net