Lists: | pgsql-hackers |
---|
From: | "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | function to display ddl |
Date: | 2010-02-14 15:32:35 |
Message-ID: | A434C531E37AD442815608A769550D80592F8DE1B9@EGEXCMB01.oww.root.lcl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
Is there a PG command or fuction that will return table ddl?
Thanks
Doug Little
Sr. Data Warehouse Architect | Enterprise Data Management | Orbitz Worldwide
500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741
Douglas(dot)Little(at)orbitz(dot)com<mailto:Douglas(dot)Little(at)orbitz(dot)com>
[cid:image001(dot)jpg(at)01CAAD58(dot)A438BEB0] orbitz.com<http://www.orbitz.com/> | ebookers.com<http://www.ebookers.com/> | hotelclub.com<http://www.hotelclub.com/> | cheaptickets.com<http://www.cheaptickets.com/> | ratestogo.com<http://www.ratestogo.com/> | asiahotels.com<http://www.asiahotels.com/>
From: | Yeb Havinga <yebhavinga(at)gmail(dot)com> |
---|---|
To: | "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: function to display ddl |
Date: | 2010-02-14 16:08:05 |
Message-ID: | 4B781FE5.7010202@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Little, Douglas wrote:
>
> Hi,
>
>
>
> Is there a PG command or fuction that will return table ddl?
>
If you just want the definition,in psql type \d tablename.
To dump ddl the pg_dump with proper arguments can dump just the ddl of a
single table. (see pg_dump --help)
I'm not aware of a command or function that returns it though.
Regards,
Yeb Havinga
From: | "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: function to display ddl |
Date: | 2010-02-14 17:17:42 |
Message-ID: | 20100214171741.GC10939@rice.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sun, Feb 14, 2010 at 05:08:05PM +0100, Yeb Havinga wrote:
> Little, Douglas wrote:
> >
> >Hi,
> >
> >
> >
> >Is there a PG command or fuction that will return table ddl?
> >
> If you just want the definition,in psql type \d tablename.
> To dump ddl the pg_dump with proper arguments can dump just the ddl of a
> single table. (see pg_dump --help)
more of a pg-users question, but since we've got a partial answer here,
might as well complete it. Try psql -E, then \d sometable to see the
commands psql issues to generate its display.
Ross
--
Ross Reedstrom, Ph.D. reedstrm(at)rice(dot)edu
Systems Engineer & Admin, Research Scientist phone: 713-348-6166
The Connexions Project http://cnx.org fax: 713-348-3665
Rice University MS-375, Houston, TX 77005
GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E F888 D3AE 810E 88F0 BEDE