From: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | Ricky Tompu Breaky <ricky(dot)breaky(at)uni(dot)de> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: How should the first step of PostgreSQL implementation should be? |
Date: | 2009-09-27 12:16:21 |
Message-ID: | dcc563d10909270516xbc076ekfc0c2537088cb54e@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sun, Sep 27, 2009 at 2:36 AM, Ricky Tompu Breaky <ricky(dot)breaky(at)uni(dot)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. :)
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Mason | 2009-09-27 13:47:06 | Re: Newbie's question: How can I connect to my postgresql-server? |
Previous Message | Alban Hertroys | 2009-09-27 09:36:09 | Re: How should the first step of PostgreSQL implementation should be? (revised) |