Re: Connect without specifying a database? - Mailing list pgsql-general

From Tom Lane
Subject Re: Connect without specifying a database?
Date
Msg-id 3121.1239474305@sss.pgh.pa.us
Whole thread Raw
In response to Re: Connect without specifying a database?  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "lists@mgreg.com"
Date:
Subject: Re: Connect without specifying a database?
Next
From: "Gerry Scales"
Date:
Subject: Maximum number of columns in a table