Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 012EB2E2EA5 for ; Wed, 28 Nov 2007 11:29:34 -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 17168-01-5 for ; Wed, 28 Nov 2007 11:29:29 -0400 (AST) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by postgresql.org (Postfix) with ESMTP id E66422E2DF4 for ; Wed, 28 Nov 2007 11:29:29 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay01.plus.net with esmtp (Exim) id 1IxOqr-0007yA-VB; Wed, 28 Nov 2007 15:29:26 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 32434274060; Wed, 28 Nov 2007 15:29:24 +0000 (GMT) Message-ID: <474D8953.6060900@archonet.com> Date: Wed, 28 Nov 2007 15:29:23 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: John van Zantvoort CC: pgsql-sql@postgresql.org Subject: Re: obtaining column names from tables or views References: <872c5faa0711280713t4627c24fj2992abe1487df9ed@mail.gmail.com> In-Reply-To: <872c5faa0711280713t4627c24fj2992abe1487df9ed@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/143 X-Sequence-Number: 29671 John van Zantvoort wrote: > moin, > > I've got a question. I'm scripting against an existing postgresql database > environment and need to tweak queries based on the columns in the views or > tables, how can if find these w/o querying the tables or views. There is a whole section of the manual devoted to the system catalogues: http://www.postgresql.org/docs/8.2/static/catalogs.html Or there's the "information schema" which is in a standardised layout but doesn't include PG-specific details. http://www.postgresql.org/docs/8.2/static/information-schema.html -- Richard Huxton Archonet Ltd