pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jseymour@linxnet.com
To: pgsql-admin@postgresql.org
Subject: Re: Syntax question
Date: Mon,  7 Jun 2004 17:47:43 -0400 (EDT)
Message-ID: <20040607214743.C37C4430E@jimsun.linxnet.com> (raw)
In-Reply-To: <DKEOLMMDNDLJFHJODEJJOEMKCCAA.jstout@cctus.com>

"Jeff Stout" <jstout@cctus.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



view thread (4+ messages)  latest in thread

Message-ID: <20040607214743.C37C4430E@jimsun.linxnet.com>
Permalink:  ../20040607214743.C37C4430E@jimsun.linxnet.com/
Also on:    postgresql.org/message-id/20040607214743.C37C4430E@jimsun.linxnet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jseymour@linxnet.com
  Subject: Re: Syntax question
  In-Reply-To: <20040607214743.C37C4430E@jimsun.linxnet.com>
  References: <DKEOLMMDNDLJFHJODEJJOEMKCCAA.jstout@cctus.com> <20040607214743.C37C4430E@jimsun.linxnet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox