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

From Ozz Nixon
Subject Re: Equivalent to "use database" in postgre
Date
Msg-id 941275E3-9AC9-4296-BEF0-58ECECBEDF9B@gmail.com
Whole thread Raw
In response to Re: Equivalent to "use database" in postgre  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
On Jun 25, 2010, at 10:48 AM, Scott Marlowe wrote:

> On Fri, Jun 25, 2010 at 7:10 AM, javijava <welove.e.music@gmail.com> wrote:
>>
>> Hi,
>>
>> i'm newby in postgre sql world.
>>
>> i need to know how to do a simple script  that create a database,the y
>> select it (in other languajes using USE) and after create tables with this
>> database.
>>
>>
>> How can I say "use name_database" on postgre sql?
>
> You have to re-connect to use a different db in pgsql.

And to elaborate a little more, the true need for "use database" for MySQL is not truly needed in most other RDBMS
solutions.In MySQL this allows you to use different database engines for different databases. It also allowed you to
keepyour project independent of others. Where more robust engines use schema and tablespace concepts to achieve this
foryou. 

So, I would not implement a re-connect theory, I would suggest researching the database(s) you plan on supporting and
seeingif there is a better way to leverage that engine for your needs. Which means, you need to know your needs - do
youneed data separation? Or, are you just used to sending the "use database" command? 

Ozz

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Equivalent to "use database" in postgre
Next
From: Craig Ringer
Date:
Subject: Re: Equivalent to "use database" in postgre