Re: Connect without specifying a database?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Connect without specifying a database?
Дата
Msg-id 25328.1239468622@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Connect without specifying a database?  ("lists@mgreg.com" <lists@mgreg.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Connect without specifying a database?
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Connect without specifying a database?