Skip site navigation (1) Skip section navigation (2)

Re: About table schema

From: Janning Vygen <vygen(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: About table schema
Date: 2004-05-25 22:57:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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,

In response to


pgsql-general by date

Next:From: Tom AllisonDate: 2004-05-25 23:02:00
Subject: unix_socket
Previous:From: Wei ShiDate: 2004-05-25 22:36:10
Subject: About table schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group