Re: About table schema - Mailing list pgsql-general

From Janning Vygen
Subject Re: About table schema
Date
Msg-id 200405260057.59307.vygen@gmx.de
Whole thread Raw
In response to About table schema  (Wei Shi <weishisky@yahoo.com>)
Responses Re: About table schema
List pgsql-general
Am Mittwoch, 26. Mai 2004 00:36 schrieb Wei Shi:
> Hi, does anyone know how to get the schema information
> of a table.  More specifically, I would like to know
>
> 1. which field(s) are primary keys?
> 2. the data type of each field of a table?
> 3. If a field is a foreign key, what field/table it
> is referring to.

connect to your database with 'psql' and type

\d tablename

which gives you all information you asked for. Type \? for a list of other
commands within psql and take a look at 'man psql'

kind regards,
janning

pgsql-general by date:

Previous
From: Wei Shi
Date:
Subject: About table schema
Next
From: Tom Allison
Date:
Subject: unix_socket