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 686DC52848 for ; Mon, 18 Jul 2005 14:09:28 -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 02630-10 for ; Mon, 18 Jul 2005 17:09:25 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.193]) by svr1.postgresql.org (Postfix) with ESMTP id 4988652B11 for ; Mon, 18 Jul 2005 14:09:24 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id i11so921605nzh for ; Mon, 18 Jul 2005 10:09:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=afeQVk0SZ+TGpfbh/XHQS7m8jsv3v74mZlD0cbO8PypVlwIxlS1P7OA0wjHe5DYNI5qw1+TljWjrTwiugwBptuxNW0V1rDuGHUa48X+7DwjCeecxhLuDhCerJFQHdfHJyJcylhfzRXKXTY0uWeiyX19quXr9tsPINm3HP8MCqGI= Received: by 10.36.141.3 with SMTP id o3mr3830977nzd; Mon, 18 Jul 2005 10:08:57 -0700 (PDT) Received: by 10.36.22.20 with HTTP; Mon, 18 Jul 2005 10:08:56 -0700 (PDT) Message-ID: <758d5e7f0507181008403969ec@mail.gmail.com> Date: Mon, 18 Jul 2005 19:08:56 +0200 From: Dawid Kuroczko Reply-To: Dawid Kuroczko To: Mark Fenbers Subject: Re: Dumping table definitions Cc: Pg SQL Discussion Group In-Reply-To: <42DBDDEE.3090903@noaa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42DBDDEE.3090903@noaa.gov> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.609 tagged_above=0 required=5 tests=AWL, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/156 X-Sequence-Number: 22134 On 7/18/05, Mark Fenbers wrote: > 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? pg_dump is your friend! Use option -s (--schema-only). It will dump the information you want. :-) Regards, Dawid