Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 44C802E004D; Wed, 27 Feb 2008 13:12:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 22693-03; Wed, 27 Feb 2008 13:12:05 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 7CA272E0049; Wed, 27 Feb 2008 13:12:05 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id m1RHC41Z053917; Wed, 27 Feb 2008 13:12:04 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id m1RGvoUU048094; Wed, 27 Feb 2008 12:57:50 -0400 (AST) (envelope-from news) Date: Wed, 27 Feb 2008 11:57:49 -0500 From: Lew User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 X-Newsgroups: pgsql.sql,pgsql.admin Subject: Re: how do I get table DDL from psql (not from pg_dump) References: <20080227121911.GE21865@a-kretschmer.de> In-Reply-To: <20080227121911.GE21865@a-kretschmer.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 23 X-Usenet-Provider: http://www.giganews.com X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 To: pgsql-admin@postgresql.org.pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/371 X-Sequence-Number: 28445 A. Kretschmer wrote: > am Wed, dem 27.02.2008, um 5:22:33 -0600 mailte Sofer, Yuval folgendes: >> 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? > > Why not using pg_dump? > > You can specify with -n and -t an arbitrary table and with -s you get > only the DDL, not the data. The "-s" option has come up as an answer to both multi-posted instances of this question. -- Lew