Re: Equivalent to "use database" in postgre - Mailing list pgsql-general

From Michael Nolan
Subject Re: Equivalent to "use database" in postgre
Date
Msg-id AANLkTilfx1Pmnd8GP7EqhunmDx_w0T3Q3QdCOrmcfIeQ@mail.gmail.com
Whole thread Raw
In response to Re: Equivalent to "use database" in postgre  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general


On Fri, Jun 25, 2010 at 10:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Scott Marlowe <scott.marlowe@gmail.com> writes:
> On Fri, Jun 25, 2010 at 7:10 AM, javijava <welove.e.music@gmail.com> wrote:
>> How can I say "use name_database" on postgre sql?

> You have to re-connect to use a different db in pgsql.

But keep in mind that mysql databases are more nearly akin to what
postgres calls schemas.  The best way to do what you want might be
to translate your mysql DBs into schemas, and then "set search_path"
would be a good approximation to "use".

The issue here may be data isolation.   Suppose you have two independent groups, one with database A and one with database B.  (Think of a company that hosts databases for its customers, for example.) 

In the ideal situation, the people with access only to database A should not even be able to learn that database B exists, much less access it in any fashion. 

I believe PG does not have the capability to completely isolate other databases from users running on the same server, I'm not sure if MySQL does or not.

However, if there are any times when it might be necessary to query both database A and database B, then schemas are the way to go. 
--
Mike Nolan
PG user by choice
MySQL user by necessity

pgsql-general by date:

Previous
From: "A.M."
Date:
Subject: Re: flatten pg_auth_members
Next
From: David Fetter
Date:
Subject: Re: Need Some Recent Information on the Differences between Postgres and MySql