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

From John R Pierce
Subject Re: Equivalent to "use database" in postgre
Date
Msg-id 4C24F39F.3070002@hogranch.com
Whole thread Raw
In response to Equivalent to "use database" in postgre  (javijava <welove.e.music@gmail.com>)
List pgsql-general
On 06/25/10 4:10 AM, javijava wrote:
> 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?
>
> Thanks in advance 4 the help!!
>

IF you are using the psql command line utility to execute these scripts,
then
     \c dbname
will connect to a new database.  However, if you're processing these
scripts some other way, then your app will have to disconnect from the
one database and connect to the other itself (this is what the \c
command tells psql to do)



pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Backup issues
Next
From: Adrian Klaver
Date:
Subject: Re: PG dump and restore