Re: Listing databases

From: Mark Harrison <mh(at)pixar(dot)com>
To: Doug Hall <doug_hall(at)aidt(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Listing databases
Date: 2004-05-05 22:07:35
Message-ID: 409965A7.60507@pixar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doug Hall wrote:
> Sorry for the newbie question, but how do you get PostgreSQL to list the
> available databases? I know how to log into a certain database, but not
> list all of them. I know this must be possible because the phppgAdmin
> web site demonstrates it with their trial server.
>
> Thanks,
> Doug Hall

Try \? in psql, it will show some really nice commands. \d will show you the
tables, and "\d tablename" will describe the table.

Try \dS and friends to see the system tables.

One of the best ways to see what is going on under the covers to to
run psql --echo-hidden:

--echo-hidden
Echoes the actual queries generated by \d and other
backslash commands. You can use this if you wish to
include similar functionality into your own pro­
grams. This is equivalent to setting the variable
ECHO_HIDDEN from within psql.

Whoever thought to add this to psql is a genius!!!

HTH...
Mark

--
Mark Harrison
Pixar Animation Studios

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2004-05-05 22:10:28 Re: sql standard: \' or ''
Previous Message Martijn van Oosterhout 2004-05-05 22:05:46 Re: Listing databases