Re: Connect without specifying a database?

From: Christophe <xof(at)thebuild(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Connect without specifying a database?
Date: 2009-04-11 17:29:11
Message-ID: 886D8666-7C2B-4102-8140-60EA448C6203@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 11, 2009, at 10:15 AM, lists(at)mgreg(dot)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. :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2009-04-11 17:34:35 Re: Connect without specifying a database?
Previous Message lists@mgreg.com 2009-04-11 17:15:44 Re: Connect without specifying a database?