Re: Equivalent to "use database" in postgre

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: Equivalent to "use database" in postgre
Дата
Msg-id m3mxujgnsl.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на Equivalent to "use database" in postgre  (javijava <welove.e.music@gmail.com>)
Список pgsql-general
javijava <welove.e.music@gmail.com> wrote:

> 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 must specify the database to use on connect; if you want
to use psql for your script, you can use "\c name_database"
à la:

| CREATE DATABASE testdatabase;
| \c testdatabase
| CREATE TABLE testtable (testcolumn int);

Tim

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Equivalent to "use database" in postgre
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Equivalent to "use database" in postgre