describe command for

Started by Little, Douglasalmost 14 years ago4 messagesgeneral
Jump to latest
#1Little, Douglas
DOUGLAS.LITTLE@orbitz.com

Is there a postgres sql command/function that will display an object ddl?

I know of the psql metacharacters, but don't know how I'd submit from a non-psql client like sqldbx.
I see that pgadmin generates a query and then formats into a ddl statement, but this seems like a lot of work for something that I would expect to be part of the command set.

Thanks

Doug Little

Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide
500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741
Douglas.Little@orbitz.com<mailto:Douglas.Little@orbitz.com>
[cid:image001.jpg@01CD4583.580D4770] orbitz.com<http://www.orbitz.com/&gt; | ebookers.com<http://www.ebookers.com/&gt; | hotelclub.com<http://www.hotelclub.com/&gt; | cheaptickets.com<http://www.cheaptickets.com/&gt; | ratestogo.com<http://www.ratestogo.com/&gt; | asiahotels.com<http://www.asiahotels.com/&gt;

Attachments:

image001.jpgimage/jpeg; name=image001.jpgDownload
#2René Romero Benavides
ichbinrene@gmail.com
In reply to: Little, Douglas (#1)
Re: describe command for

Am 08.06.2012 14:31, schrieb Little, Douglas:

Is there a postgres sql command/function that will display an object ddl?

I know of the psql metacharacters, but don't know how I'd submit from
a non-psql client like sqldbx.

I see that pgadmin generates a query and then formats into a ddl
statement, but this seems like a lot of work for something that I
would expect to be part of the command set.

Thanks

*Doug Little*

**

Sr. Data Warehouse Architect | Business Intelligence Architecture |
Orbitz Worldwide

500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 |
Fax 312.894.5164 | Cell 847-997-5741

*Douglas.Little@orbitz.com* <mailto:Douglas.Little@orbitz.com>*__*

Description: cid:image001.jpg@01CABEC8.D4980670 orbitz.com
<http://www.orbitz.com/&gt; | ebookers.com <http://www.ebookers.com/&gt; |
hotelclub.com <http://www.hotelclub.com/&gt; | cheaptickets.com
<http://www.cheaptickets.com/&gt; | ratestogo.com
<http://www.ratestogo.com/&gt;| asiahotels.com <http://www.asiahotels.com/&gt;

Use pg_dump , you can define for what tables you want it to generate ddl
for (check the -n and -t options) . If you pass it a -s OR --schema-only
it will only dump data definitions (ddl).

--
pglearn.blogspot.mx:postgresql recipes <http://pglearn.blogspot.mx/&gt;
*Twitter*.You might consider to follow *@sqlhotfix*

#3Bartosz Dmytrak
bdmytrak@gmail.com
In reply to: Little, Douglas (#1)
Re: describe command for

2012/6/8 Little, Douglas <DOUGLAS.LITTLE@orbitz.com>

Is there a postgres sql command/function that will display an object ddl?*
***

Hi,
try some from this list:
http://www.postgresql.org/docs/9.1/static/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE

reagrds,
Bartek

#4René Romero Benavides
ichbinrene@gmail.com
In reply to: Bartosz Dmytrak (#3)
Re: describe command for

Am 08.06.2012 14:50, schrieb Bartosz Dmytrak:

2012/6/8 Little, Douglas <DOUGLAS.LITTLE@orbitz.com
<mailto:DOUGLAS.LITTLE@orbitz.com>>

Is there a postgres sql command/function that will display an
object ddl?

Hi,
try some from this list:
http://www.postgresql.org/docs/9.1/static/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE

reagrds,
Bartek

Wow, very nice functions, didn't know them. Thanks for this great info
Bartek!

--
pglearn.blogspot.mx:postgresql recipes <http://pglearn.blogspot.mx/&gt;
*Twitter*.You might consider to follow *@sqlhotfix*