Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6A8762E003D for ; Wed, 27 Feb 2008 13:34:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 46504-09 for ; Wed, 27 Feb 2008 13:34:13 -0400 (AST) X-Greylist: delayed 02:10:43.139184 by SQLgrey-1.7.5 Received: from smtp1.execulink.net (smtp1.execulink.net [69.63.44.82]) by postgresql.org (Postfix) with ESMTP id 15B042E0032 for ; Wed, 27 Feb 2008 13:34:13 -0400 (AST) Received: from t60p.bax.ca (node-6964.tor.pppoe.execulink.com [67.158.75.53]) by smtp1.execulink.net (8.13.1/8.13.1) with ESMTP id m1RFNS3x014898 for ; Wed, 27 Feb 2008 10:23:29 -0500 Message-ID: <47C58070.2090809@sympatico.ca> Date: Wed, 27 Feb 2008 10:23:28 -0500 From: Frank Bax User-Agent: Thunderbird 2.0.0.6 (X11/20070818) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: how do I get table DDL from psql (not from pg_dump) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.064 tagged_above=0 required=5 tests=AWL=0.064 X-Spam-Level: X-Archive-Number: 200802/223 X-Sequence-Number: 30314 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) This command should output the SQL you need... echo '\d tablename' | psql -E