From: | Jeff Frost <jeff(at)frostconsultingllc(dot)com> |
---|---|
To: | Richard Ray <rray(at)mstc(dot)state(dot)ms(dot)us> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: How to query by column names |
Date: | 2007-01-22 23:29:36 |
Message-ID: | Pine.LNX.4.64.0701221528250.5992@discord.home.frostconsultingllc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I think this is what you're looking for Richard:
SELECT attname FROM pg_attribute pa, pg_class pc
WHERE pc.relname = 't1'
AND pa.attrelid = pc.relfilenode
AND pa.attisdropped IS FALSE
AND pa.attnum > 0;
Let me know if it doesn't do what you intended.
On Mon, 22 Jan 2007, Richard Ray wrote:
> This may be a simple but can I create a query such as
>
> select (select attname from pg_attribute where attrelid = (select relfilenode
> from pg_class where relname = 't1') and attisdropped = false and attnum > 0)
> from t1;
>
> I get
> ERROR: more than one row returned by a subquery used as an expression
>
> Thanks
> Richard
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
>
--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Ray | 2007-01-22 23:58:23 | Re: How to query by column names |
Previous Message | Richard Ray | 2007-01-22 22:25:08 | How to query by column names |