Laurenz Albe <laurenz.a...@cybertec.at> 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 to >> 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