pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Ray <rray@mstc.state.ms.us>
To: pgsql-sql@postgresql.org
Subject: How to query by column names
Date: Mon, 22 Jan 2007 16:25:08 -0600 (CST)
Message-ID: <Pine.LNX.4.64.0701221612220.10491@rray.drdc.mstc.ms.gov> (raw)

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



view thread (12+ messages)  latest in thread

Message-ID: <Pine.LNX.4.64.0701221612220.10491@rray.drdc.mstc.ms.gov>
Permalink:  ../Pine.LNX.4.64.0701221612220.10491@rray.drdc.mstc.ms.gov/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.0701221612220.10491@rray.drdc.mstc.ms.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rray@mstc.state.ms.us
  Subject: Re: How to query by column names
  In-Reply-To: <Pine.LNX.4.64.0701221612220.10491@rray.drdc.mstc.ms.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox