X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 88A4152AFA for ; Mon, 18 Jul 2005 13:56:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02002-03 for ; Mon, 18 Jul 2005 16:56:42 +0000 (GMT) Received: from amanda.contactbda.com (ipn36372-e65122.cidr.lightship.net [216.204.66.226]) by svr1.postgresql.org (Postfix) with ESMTP id 3BC6A52AA6 for ; Mon, 18 Jul 2005 13:56:41 -0300 (ADT) Received: from amanda.contactbda.com (amanda.contactbda.com [192.168.1.2]) by amanda.contactbda.com (8.12.11/8.12.11/Debian-3) with ESMTP id j6IGuZIe005901; Mon, 18 Jul 2005 12:56:35 -0400 From: "Jim Buttafuoco" To: "Mark Fenbers" , Pg SQL Discussion Group Reply-To: jim@contactbda.com Subject: Re: Dumping table definitions Date: Mon, 18 Jul 2005 12:56:35 -0400 Message-Id: <20050718165607.M86774@contactbda.com> In-Reply-To: <42DBDDEE.3090903@noaa.gov> References: <42DBDDEE.3090903@noaa.gov> X-Mailer: Open WebMail 2.41 20040926 X-OriginatingIP: 192.168.1.1 (jim) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.052 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/155 X-Sequence-Number: 22133 use pg_dump with the --schema-only and --table= params ---------- Original Message ----------- From: "Mark Fenbers" To: Pg SQL Discussion Group Sent: Mon, 18 Jul 2005 12:50:54 -0400 Subject: [SQL] Dumping table definitions > I am looking for a way to reformat the information that is generated from > \d mytable > into SQL syntax, such that the table can be recreated with 'psql -f > mytable.sql' complete with index and constraint definitions. I can do > awk and sed commands to do this if I need to, but first wanted to check > if Pg already had tools to export the table structure (without the > data). Does it? > > Also, Is there a way to export the structure of all tables at once > instead of one table at a time? > > Mark ------- End of Original Message -------