Re: Syntax question

From: jseymour(at)linxnet(dot)com (Jim Seymour)
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Syntax question
Date: 2004-06-07 21:47:43
Message-ID: 20040607214743.C37C4430E@jimsun.linxnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Jeff Stout" <jstout(at)cctus(dot)com> wrote:
>
> I am fairly new to postgres, I need to know how to switch
> databases once I'm in a psql session. I can't seem to find the
> command for \h , maybe I just blind |-;

"\?" is your friend...

$ psql
Password:
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

jseymour=> \?
General
\c[onnect] [DBNAME|- [USER]]
connect to new database (currently "jseymour")
[snip]

jseymour=> \l
List of databases
Name | Owner | Encoding
-----------+----------+-----------
bookbiz | jseymour | SQL_ASCII
bookbiz2 | jseymour | SQL_ASCII
jseymour | jseymour | SQL_ASCII
mydb | jseymour | SQL_ASCII
[snip]
(12 rows)

jseymour=> \c mydb
You are now connected to database "mydb".
mydb=>

HTH,
Jim

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ray Ontko 2004-06-07 22:05:20 Re: E-R Tool
Previous Message Scott Marlowe 2004-06-07 21:35:55 Re: Syntax question