Re: how do I get table DDL from psql (not from pg_dump)

Lists: pgsql-admin
From: "Sofer, Yuval" <Yuval_Sofer(at)bmc(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: how do I get table DDL from psql (not from pg_dump)
Date: 2008-02-27 11:21:08
Message-ID: BE67D1149BBD5746984545ED91F702E0BD4ADE@hou-ex-02.adprod.bmc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi

I need to extract table DDL (create script) from database connection
(using sql, by retrieving system table info or by activating some pg
function)

Is this possible in postgres?

Please help

Thanks

Yuval Sofer
BMC Software
CTM&D Business Unit

DBA Team
972-52-4286-282
yuval_sofer(at)bmc(dot)com


From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: how do I get table DDL from psql (not from pg_dump)
Date: 2008-02-27 15:50:08
Message-ID: 20080227155008.GA7920@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Wed, Feb 27, 2008 at 05:21:08AM -0600, Sofer, Yuval wrote:
> I need to extract table DDL (create script) from database connection
> (using sql, by retrieving system table info or by activating some pg
> function)

pg_dump -s does this. See the manual for more details on the switches.

A