Re: DDL from psql console? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: DDL from psql console?
Date
Msg-id 1114443709.13303.91.camel@state.g2switchworks.com
Whole thread Raw
In response to DDL from psql console?  (John Browne <jkbrowne@gmail.com>)
List pgsql-general
On Mon, 2005-04-25 at 10:29, John Browne wrote:
> Hello,
>
> I was curious if there was a way to get the DDL for a particular table
> from the psql client console?  I have two postgres boxes (development
> and production) and would like to copy & paste the DDL "CREATE TABLE"
> statements from the development console to the production console when
> I'm moving a particular table definition over.  I tried \dt+ but it
> didn't appear to show it.

I don't think you can get it from within psql, but you can get it with
pg_dump from the command line:

pg_dump -st tablename dbname

pgsql-general by date:

Previous
From: Thomas F.O'Connell
Date:
Subject: Re: DDL from psql console?
Next
From: John Browne
Date:
Subject: Re: DDL from psql console?