Sam Mason <sam@samason.me.uk> writes:
> As others have said; the design of PG is such that it's built to assume
> you're always connected to exactly one database. I'd guess this is an
> artifact from a long time ago when PG didn't have multiple databases.
It's possible that that was true way back in Berkeley prehistory; there
is no one around the project now that would remember (unless maybe Elein
does). But the key points here are that critical catalogs like pg_class
and pg_proc are per-database, which is a good thing for quite a number
of reasons, and PG is sufficiently catalog-driven that it's literally
impossible for the engine to do anything useful without having a set of
those catalogs available. (Offhand, the only user-visible functionality
I can think of that isn't catalog-dependent is the GUC parameters, ie
SET/SHOW; and even within that there are some individual parameters
that can't meaningfully be set without catalog access.)
regards, tom lane