Re: how to recall the initial definition (CREATE TABLE)

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: Joao Miguel Ferreira <jmf(at)estg(dot)ipvc(dot)pt>, pgsql-novice(at)postgresql(dot)org
Subject: Re: how to recall the initial definition (CREATE TABLE)
Date: 2006-01-09 15:38:06
Message-ID: c2d9e70e0601090738s213f90d1x44c7f2ee2d05e73@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 1/9/06, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
>
>
>
> On 1/9/06 1:27 PM, "Joao Miguel Ferreira" <jmf(at)estg(dot)ipvc(dot)pt> wrote:
>
> > Hello all at PG,
> >
> > Let's say I forgot the "definition" of a table (.. the original CREATE
> > TABLE query)...
>
> Use pg_dump or use some program like PgAdminIII to give you the table
> definition. There is no "DESCRIBE mytable" like in MySQL.
>
> Sean
>
>

or inside psql you can execute the \d command table to see the table
definition...

or even you can do in the shelll

psql -U postgres -d database_name -c "\d schema_name.table_name" > file

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Neil Saunders 2006-01-09 15:52:32 Re: What does 'schema' mean ?
Previous Message Brad Nicholson 2006-01-09 15:35:08 Re: how to list all tables in a database