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.94.2) (envelope-from ) id 1u53v9-00BaFe-GO for pgsql-general@arkaria.postgresql.org; Wed, 16 Apr 2025 14:39:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u53v6-00GHL5-Uo for pgsql-general@arkaria.postgresql.org; Wed, 16 Apr 2025 14:39:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u53v6-00GHKx-JN for pgsql-general@lists.postgresql.org; Wed, 16 Apr 2025 14:39:21 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u53v5-000O12-0V for pgsql-general@lists.postgresql.org; Wed, 16 Apr 2025 14:39:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 53GEdEcf1898935; Wed, 16 Apr 2025 10:39:14 -0400 From: Tom Lane To: Laurenz Albe cc: Dominique Devienne , Adrian Klaver , "David G. Johnston" , Igor Korot , "pgsql-generallists.postgresql.org" Subject: Re: Fwd: Identify system databases In-reply-to: <2dffe860b085b927726a052bcfe16ede704ab923.camel@cybertec.at> References: <817abeac-d628-4279-bfef-9e1e3aa1884b@aklaver.com> <25b6cd49-f871-47fe-bf3b-5416637736ca@aklaver.com> <2dffe860b085b927726a052bcfe16ede704ab923.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Wed, 16 Apr 2025 14:30:27 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1898933.1744814354.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 16 Apr 2025 10:39:14 -0400 Message-ID: <1898934.1744814354@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: >> Authentication is cluster-wide, not DB specific, so I'd welcome a way t= o connect >> to the cluster, not a specific DB, and introspect shared-objects, >> including databases >> I'm allowed to connect to, which could be an empty list. > It is deep in the DNA of PostgreSQL that you always have to connect to > a database, unless you establish a replication connection. > I am surprised that you perceive that as a problem or limitation. That isn't going to change, and here's why not: a lot of the critical catalogs are per-database not shared. You aren't going to get anywhere "introspecting shared objects" when you don't have a copy of pg_class with which to find the shared catalogs, nor a copy of pg_proc with which to look up index access method support procedures, etc etc. You could imagine making up some mini-database that is somehow forbidden from gaining any user-defined objects and then using that, but I fail to see why that's a better idea than the approach we use now. Not being able to use any user-defined functions or views seems like a pretty huge handicap. And this hypothetical new mini-database *would* be a special snowflake in a way that none of the existing ones are, in that the system would have to prevent actions that are perfectly okay in any other one. I don't perceive that as a good thing. (You can, of course, speculate about some major rearchitecting of the system catalogs that would make this situation different. I doubt that's going to happen at this point, though. There's too much stuff that's dependent on how things are now.) regards, tom lane