X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7B7043B2E4B; Wed, 15 Dec 2004 15:17:22 +0000 (GMT) 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 62887-01; Wed, 15 Dec 2004 15:17:08 +0000 (GMT) Received: from 3times25.net (duck.3times25.net [66.23.211.34]) by svr1.postgresql.org (Postfix) with ESMTP id 097843AC008; Wed, 15 Dec 2004 15:17:10 +0000 (GMT) Received: from [127.0.0.1] (rhws.home.edu [127.0.0.1]) by 3times25.net (Postfix) with ESMTP id AA4AF746D3; Wed, 15 Dec 2004 10:17:10 -0500 (EST) Message-ID: <41C05576.7030703@3times25.net> Date: Wed, 15 Dec 2004 10:17:10 -0500 From: Geoffrey User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsqlnovice , pgsqlperform Subject: Re: \d output to a file References: <20041215143822.37534.qmail@web51304.mail.yahoo.com> In-Reply-To: <20041215143822.37534.qmail@web51304.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/108 X-Sequence-Number: 11685 sarlav kumar wrote: > Hi All, > > I would like to write the output of the \d command on all tables in a > database to an output file. There are more than 200 tables in the > database. I am aware of \o command to write the output to a file. > But, it will be tough to do the \d for each table manually and write > the output to a file. Is there a command/ way in which I can achieve > this without having to do it for each table? Any help in this regard > would be really appreciated. What is the OS? On any UNIX variant you can do: echo '\d' | psql > outputfile But this will get you the system tables as well I think. Alternately you could do something like: for table in $( outputfile -- Until later, Geoffrey