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

From Tom Lane
Subject Re: Connect without specifying a database?
Date
Msg-id 25328.1239468622@sss.pgh.pa.us
Whole thread Raw
In response to Re: Connect without specifying a database?  ("lists@mgreg.com" <lists@mgreg.com>)
List pgsql-general
"lists@mgreg.com" <lists@mgreg.com> writes:
> What do you mean when you say the "catalogs...are database-
> specific" ?  If I'm understanding what you're saying, my whole point
> is that I don't want to be tied to a database to do any kind of
> querying about the PG engine itself.  Does that make sense?

No, it does not.  This is perhaps an implementation quirk of Postgres's,
but it does have some advantages and we're not interested in giving them
up just because it confuses MySQLers ;-).  The main advantage is that
having separate catalogs in each database is more robust (no matter how
badly database A gets messed up, database B will be okay) and reduces
contention for catalog access.

There are a few catalogs that are visible in all databases of an
installation (pg_database itself being the most obvious one) but they
are not sufficient to support an operational backend.  So you have to
connect to some database even to query those catalogs.

We could have a convention that there is some database that you connect
to only for the purpose of inspecting pg_database, but there doesn't
seem a whole lot of point in trying to enforce that.  The standard
databases serve well enough.

            regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Connect without specifying a database?
Next
From: John R Pierce
Date:
Subject: Re: Connect without specifying a database?