pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: boraldomaster@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8242: No way to debug "subquery must return only one column" error
Date: Thu, 20 Jun 2013 15:28:33 -0400
Message-ID: <24774.1371756513@sss.pgh.pa.us> (raw)
In-Reply-To: <E1Upc8w-0003OT-U0@wrigleys.postgresql.org>
References: <E1Upc8w-0003OT-U0@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

boraldomaster@gmail.com writes:
> When I get this message I cannot guess from it's description what really
> causes this error.
> I would like to see exactly the subquery that returned more than one column
> and the row where this happened.

That's a parse-time error, so it's nonsensical to ask for "the row where
it happened".  AFAICS, the parser should give back a syntax-error
pointer for this error; for example, when I try to provoke the error in
psql, I get

=# select * from table1 where id = any(array(select c1,c2 from table2));
ERROR:  subquery must return only one column
LINE 1: select * from table1 where id = any(array(select c1,c2 ...
                                            ^

which shows me that the problem is associated with the ARRAY() construct
not accepting multiple input columns.  If you're not seeing such an
error pointer, it's the fault of whatever client-side software you're
working in.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <24774.1371756513@sss.pgh.pa.us>
Permalink:  ../24774.1371756513@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24774.1371756513@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, boraldomaster@gmail.com
  Subject: Re: BUG #8242: No way to debug "subquery must return only one column" error
  In-Reply-To: <24774.1371756513@sss.pgh.pa.us>
  References: <E1Upc8w-0003OT-U0@wrigleys.postgresql.org> <24774.1371756513@sss.pgh.pa.us>

* 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