Re: Connect without specifying a database?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: lists(at)mgreg(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Connect without specifying a database?
Date: 2009-04-12 11:03:47
Message-ID: EFC2F29D-1B59-483E-A621-21420489689D@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Apr 11, 2009, at 6:10 PM, lists(at)mgreg(dot)com wrote:

> 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?

Look at it from the other side; You have a DBMS and you want to store
information about what databases and which users are available, who
can and can't connect, etc. It makes sense to store that in a
database, right?

To request that information you need to connect to the database
server. Considering that information is stored in a database, having
to specify that database to connect to makes sense. Whether that's a
named database (with a documented fixed name of course, in this case
'template1' or 'postgres') or an anonymous database doesn't make much
difference. You'll still have to specify several other connection
parameters (host & port at least), so why not also a valid user (quite
desirable from a security point of view) and a database name?

It may not make as much sense from a user point of view, but it makes
a lot of sense from a database point of view.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,49e1ca98129741055947028!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2009-04-12 11:05:33 Re: Partitioned table and trigger/insert result horribleness
Previous Message Simon Riggs 2009-04-12 11:01:06 Re: No return from trigger function