Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C1F772E0041 for ; Wed, 28 Nov 2007 11:13:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 52257-03 for ; Wed, 28 Nov 2007 11:13:22 -0400 (AST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by postgresql.org (Postfix) with ESMTP id 8A87F2E34B1 for ; Wed, 28 Nov 2007 11:13:26 -0400 (AST) Received: by py-out-1112.google.com with SMTP id u77so3406584pyb for ; Wed, 28 Nov 2007 07:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=CbTusRFQ56hoUAIvM1sYPmztLMD9gWYKdk4P6u7GxBc=; b=UWzDDax/YAh1jhIapAQCb9affCuUedrLCM9Vln+N4YEDhN+sicYCBQ5Gio5mTvNjFyPjybn1lOXdoqYALE6D0K6KrsbLqI0khiKaa7tMQFEjKXeb7W/uYFMveJICCNidryYjkZac0E2BuuDELuyZT9BZON8EljuK4Q5X7x7fsIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:mime-version:content-type; b=hs5ZdWkh90jkM5g0+VHbpESwIvQvj1sppoSPYhuxtOUfhYXPFSympzHLat1x+6uxegba7J+NOPh1DjFLV/RQlU6BXPdf5OsfS0rwNEi+TNkaxeReT4zv/YlmGZM9TGt6BzS001Kb00lRqGP0EEfuhN/IksmcM0ebETJFQXgyzPc= Received: by 10.64.203.4 with SMTP id a4mr12272593qbg.1196262796168; Wed, 28 Nov 2007 07:13:16 -0800 (PST) Received: by 10.65.181.18 with HTTP; Wed, 28 Nov 2007 07:13:16 -0800 (PST) Message-ID: <872c5faa0711280713t4627c24fj2992abe1487df9ed@mail.gmail.com> Date: Wed, 28 Nov 2007 16:13:16 +0100 From: "John van Zantvoort" To: pgsql-sql@postgresql.org Subject: obtaining column names from tables or views MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1924_31911139.1196262796118" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/142 X-Sequence-Number: 29670 ------=_Part_1924_31911139.1196262796118 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. Currently I execute the querie and collect the columns but this is rather expensive, silly and fails when the table or view is empty. -- Met vriendelijke groeten/with kind regards John van Zantvoort --- Most burning issues generate far more heat than light. -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCM d-- s:+ a C++ UL++++ P+++ L++ E--- W++ N+ o-- K- w O M- V- PS+ PE- Y PGP++ t 5 X R- tv- b+ DI+ D+ G e h--- r++ y++ ------END GEEK CODE BLOCK------ ------=_Part_1924_31911139.1196262796118 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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.

Currently I execute the querie and collect the columns but this is rather expensive, silly and fails when the table or view is empty.

--
Met vriendelijke groeten/with kind regards

       John van Zantvoort

---
Most burning issues generate far more heat than light.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM d-- s:+ a C++ UL++++ P+++ L++ E--- W++ N+ o-- K- w
O M- V- PS+ PE- Y PGP++ t 5 X R- tv- b+ DI+ D+
G e h--- r++ y++
------END GEEK CODE BLOCK------ ------=_Part_1924_31911139.1196262796118--