Re: how to recall the initial definition (CREATE TABLE) of a table ? - Mailing list pgsql-novice

From Andrew Chambers
Subject Re: how to recall the initial definition (CREATE TABLE) of a table ?
Date
Msg-id 20060109182844.GA11970@yapgi
Whole thread Raw
In response to Re: how to recall the initial definition (CREATE TABLE) of a table ?  (<Amit_Wadhwa@Dell.com>)
List pgsql-novice
Sorry for replying to this message.  I din't seem to get the first one.

> Hello all at PG,
>
> Let's say I forgot the "definition" of a table (.. the original CREATE
> TABLE query)...
>
> how do I ask PG to tell me these definition's (int not null, text,
> foreign key, etc) ??

When in psql you can use the \d command to display the definition of any
table.  You can also use \? to see what other commands are available.

> "definition" is not the correct word for this, is it ? what's the
> correct term ?

I think "definition" is ok.  That's what I'd call it.

> PS: ok, maybe I should go back to my SQL books...

Your SQL books might not help in this situation because queries of this
type are usually dependent on the client/server you are using (for
example the Oracle version of what you're looking for is
desc <table_name>).  However, as always, Google is your friend - as are the
documentation pages of the database you're using.  Postgresql's happen
to be very good

http://www.postgresql.org/docs/8.1/static/

Regards,
Andy

pgsql-novice by date:

Previous
From: Guido Barosio
Date:
Subject: Re: how to recall the initial definition (CREATE TABLE) of a table ?
Next
From: "Luis Silva"
Date:
Subject: database ->xml