Re: how to recall the initial definition (CREATE TABLE) of a table ?

From: Andrew Chambers <andychambers2002(at)yahoo(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to recall the initial definition (CREATE TABLE) of a table ?
Date: 2006-01-09 18:28:44
Message-ID: 20060109182844.GA11970@yapgi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Luis Silva 2006-01-09 18:34:53 database ->xml
Previous Message Joao Miguel Ferreira 2006-01-09 18:27:29 how to recall the initial definition (CREATE TABLE) of a table ?