Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E9DC46326DC for ; Sun, 22 Aug 2010 17:24:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54575-03 for ; Sun, 22 Aug 2010 20:24:25 +0000 (UTC) X-Greylist: delayed 00:06:20.632932 by SQLgrey-1.7.6 Received: from spider.alvarezp.com (spider.alvarezp.com [207.210.217.159]) by mail.postgresql.org (Postfix) with ESMTP id F024C632629 for ; Sun, 22 Aug 2010 17:24:25 -0300 (ADT) Received: from localhost.localdomain (189.220.43.207.cable.dyn.cableonline.com.mx [189.220.43.207]) (authenticated bits=0) by spider.alvarezp.com (8.13.8/8.13.8/Debian-3) with ESMTP id o7MKI06J011294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 22 Aug 2010 13:18:02 -0700 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: pgsql-general@postgresql.org, "c k" Subject: Re: getting list of columns from a query References: Date: Sun, 22 Aug 2010 13:18:00 -0700 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Octavio Alvarez" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.61 (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201008/636 X-Sequence-Number: 166552 On Sun, 22 Aug 2010 10:27:52 -0700, c k wrote: > Hi all, > As I am using MS Access for a long time, many tools like ms access > provides > a way to get the list of columns from a query. (using filed list in combo > boxes in ms access). But is it possible to get such list of columns from > a > query where it is not known to the user, that which columns are defined > in > the base 'SELECT' statement? How? I dynamically created SQL statements > many > times this situation occurs where the columns are not fixed and we have > to > get the list of columns from such a query. > Thanks in advance. I am removing psql-admin from the Cc to avoid crossposting. Besides, I am not sure if it is on-topic there or not. Which version of PostgreSQL? Anyway, if you create the SELECT statement dynamically you could know a priori what columns would result, AFAIU. -- Octavio.