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

From Christophe
Subject Re: Connect without specifying a database?
Date
Msg-id 886D8666-7C2B-4102-8140-60EA448C6203@thebuild.com
Whole thread Raw
In response to Re: Connect without specifying a database?  ("lists@mgreg.com" <lists@mgreg.com>)
List pgsql-general
On Apr 11, 2009, at 10:15 AM, lists@mgreg.com wrote:
> So, how does needing to connect to a database before querying about
> existing databases make any sense?

Well, you have to connect to the database server, no matter what, in
order to check on the existence of a database (unless you are doing it
by groveling around in the data directories).  The fact that you have
to supply a database as part of that connection seems unremarkable.

Suppose the documentation said something along these lines:

"All connections are to a specific database.  For operations in which
a user-created database would be inappropriate (such as checking for
the existence of a user-created database), the database 'root' is
created by initdb as a known default for such operations."

That would seem to be utterly uncontroversial and normal, yes?

OK s/root/template1/, and you're set. :)

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Connect without specifying a database?
Next
From: Sam Mason
Date:
Subject: Re: Connect without specifying a database?