database and table listing

Started by Nonameover 25 years ago4 messagesgeneral
Jump to latest
#1Noname
steve@foxx.uklinux.net

are there any SQL statements which I can type into the psql client to give
a listing of available databases, available tables (within a database), and
to view the structure of a single table.

--
Kindness is a language which the deaf can hear and the blind can read.
-- Mark Twain

-- -- -- -- -- -- -- -- -- --

Stephen Patterson steve@foxx.UKL.net

(Replace UKL with uklinux to reply)

#2Richard Poole
richard.poole@vi.net
In reply to: Noname (#1)
Re: database and table listing

On Wed, Nov 01, 2000 at 07:00:12PM +0000, Stephen Patterson wrote:

are there any SQL statements which I can type into the psql client to give
a listing of available databases,

\l

available tables (within a database),

\d

and to view the structure of a single table.

\d tablename

All of which is in "man psql"...

These aren't SQL statements themselves, but if you start psql with
"-E", you can see the SQL queries which are sent to the backend when
you use them.

Richard

#3Marko Kreen
markokr@gmail.com
In reply to: Noname (#1)
Re: database and table listing

On Wed, Nov 01, 2000 at 07:00:12PM +0000, Stephen Patterson wrote:

are there any SQL statements which I can type into the psql client to give
a listing of available databases, available tables (within a database), and
to view the structure of a single table.

Start psql as 'psql -E' and then try psql internal commands
so you see what queries psql itself generates.

--
marko

#4Igor Roboul
igor@raduga.dyndns.org
In reply to: Richard Poole (#2)
Re: database and table listing

On Wed, Nov 01, 2000 at 07:16:16PM +0000, Richard Poole wrote:

All of which is in "man psql"...

Or just do \? at psql prompt :-) \h will give you PostgreSQL SQL statements.

--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744