Re: How should the first step of PostgreSQL implementation should be?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: How should the first step of PostgreSQL implementation should be?
Дата
Msg-id dcc563d10909270516xbc076ekfc0c2537088cb54e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How should the first step of PostgreSQL implementation should be?  (Ricky Tompu Breaky <ricky.breaky@uni.de>)
Список pgsql-general
On Sun, Sep 27, 2009 at 2:36 AM, Ricky Tompu Breaky <ricky.breaky@uni.de> wrote:

> Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>       \h for help with SQL commands
>       \? for help with psql commands
>       \g or terminate with semicolon to execute query
>       \q to quit
>
> postgres=# createdb ivia

1: This is not the SQL command, it's the command line command.  SQL is:
create database dbname;

Note the semicolon (or you can use \g to execute the buffer)

> postgres-# \du

Note that your prompt has postgres-# not postgres=#

the - tells you there's already something in the buffer.
Also, \du shows you users.  \l shows you databases.

>                               List of roles
> Role name | Superuser | Create role | Create DB | Connections | Memberof
> -----------+-----------+-------------+-----------+-------------+-----------
> <<hidden>>| yes       | yes         | yes       | no limit    | {}
> ivia      | no        | no          | no        | no limit    | {}
> postgres  | yes       | yes         | yes       | no limit    | {}
> ricky     | yes       | yes         | yes       | no limit    | {}
> (4 rows)
>
> postgres-# commit

Again, no ;.  Note that pgsql doesn't start an open transaction
automagically like oracle.  you need an explicit begin; to open a
transaction block or all your commands will be individual transactions
executed immediately when \g or a semi colon is used.

> postgres-# \q
> sussy:~ # psql -h 127.0.0.1 -U ivia -W
> Password for user ivia:
> psql: FATAL:  Datenbank »ivia« existiert nicht (my translation:
> Database does not exist. Look!!! It does not make difference although
> I created a database named 'ivia')

Nope, you only thought you did.  Go back and try again.   :)

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: How should the first step of PostgreSQL implementation should be? (revised)
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Newbie's question: How can I connect to my postgresql-server?