From: | Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> |
---|---|
To: | javijava <welove(dot)e(dot)music(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Equivalent to "use database" in postgre |
Date: | 2010-06-25 15:01:30 |
Message-ID: | 4C24C4CA.7060206@postnewspapers.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 25/06/10 19:10, javijava 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.
http://wiki.postgresql.org/wiki/FAQ
http://www.coderholic.com/postgresql-for-mysql-users/
Most MySQL users misunderstand "databases" in postgresql. The closest
equivalent in PostgreSQL to a MySQL "database" is a PostgreSQL "schema".
If you expect to be able to run queries that use data from multiple
"databases" you really want to use schema.
See the help for the "psql" command for basic scripting, including the
"\c" command to connect to another DB. For help on an SQL command, run
"\h COMMANDNAME" in psql, or read the manual for that command.
--
Craig Ringer
From | Date | Subject | |
---|---|---|---|
Next Message | Ozz Nixon | 2010-06-25 15:01:47 | Re: Equivalent to "use database" in postgre |
Previous Message | Tom Lane | 2010-06-25 15:00:44 | Re: Equivalent to "use database" in postgre |