Re: Connect without specifying a database?

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Connect without specifying a database?
Дата
Msg-id 49E0B9CB.7090408@iol.ie
обсуждение исходный текст
Ответ на Connect without specifying a database?  ("lists@mgreg.com" <lists@mgreg.com>)
Ответы Re: Connect without specifying a database?  ("lists@mgreg.com" <lists@mgreg.com>)
Список pgsql-general
On 11/04/2009 16:30, lists@mgreg.com wrote:

> Quick question:  Does PGSQL provide a mechanism by which to connect to
> the server without specifying a database?  I saw a thread back in 2005
> that said "no"
> (http://archives.postgresql.org//pgsql-interfaces/2005-02/msg00031.php),
> but I was curious as to whether that's changed.  Basically I need to be
> able to dynamically determine what databases exist etc before performing
> certain actions in my application.

The answer is still "no". :-)

The usual thing it to connect to the "postgres" database (or to
"template1" in older versions of PG), and then you can issue queries to
see what's there. You're pretty much guaranteed that one of those
databases will exist (they're created by initdb), unless whoever
installed the server did something strange.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

В списке pgsql-general по дате отправления:

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: Connect without specifying a database?
Следующее
От: "lists@mgreg.com"
Дата:
Сообщение: Re: Connect without specifying a database?