Re: Connect without specifying a database?

From: "lists(at)mgreg(dot)com" <lists(at)mgreg(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Connect without specifying a database?
Date: 2009-04-11 16:10:33
Message-ID: B5C97ED5-2D21-46EF-ABAC-D8670D476C14@mgreg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 11, 2009, at 11:56 AM, Tom Lane wrote:
>
> There are, although we don't spell the commands like that. This is
> not
> relevant to the question of whether it makes sense to connect without
> being connected to a specific database. It doesn't, because the
> catalogs that you have to inspect to find out anything are
> database-specific.
>
> regards, tom lane

I'm sorry, I'm confused by your reply. I may have said "table" when I
meant "database". I believe it absolutely *does* make sense to
connect without specifying a database first. What if you hit that
edge case where there are in fact no databases? I suppose you could
always run "createdb" just in case before you do anything else, but
that seems counterintuitive.

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?

Best,
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2009-04-11 16:35:23 Re: Connect without specifying a database?
Previous Message Ries van Twisk 2009-04-11 16:00:56 Re: Connect without specifying a database?