Skip site navigation (1) Skip section navigation (2)

Re: Equivalent to "use database" in postgre

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, javijava <welove(dot)e(dot)music(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Equivalent to "use database" in postgre
Date: 2010-06-25 16:47:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Fri, Jun 25, 2010 at 10:00 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> writes:
> > On Fri, Jun 25, 2010 at 7:10 AM, javijava <welove(dot)e(dot)music(at)gmail(dot)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

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

In response to

pgsql-general by date

Next:From: David FetterDate: 2010-06-25 17:37:01
Subject: Re: Need Some Recent Information on the Differences between Postgres and MySql
Previous:From: A.M.Date: 2010-06-25 16:28:24
Subject: Re: flatten pg_auth_members

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group