Re: DDL from psql console?

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: John Browne <jkbrowne(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DDL from psql console?
Date: 2005-04-25 15:41:49
Message-ID: 1114443709.13303.91.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Browne 2005-04-25 15:44:14 Re: DDL from psql console?
Previous Message Thomas F.O'Connell 2005-04-25 15:41:07 Re: DDL from psql console?