Re: BUG #8242: No way to debug "subquery must return only one column" error - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #8242: No way to debug "subquery must return only one column" error
Date
Msg-id 24774.1371756513@sss.pgh.pa.us
Whole thread Raw
In response to BUG #8242: No way to debug "subquery must return only one column" error  (boraldomaster@gmail.com)
Responses Re: BUG #8242: No way to debug "subquery must return only one column" error
List pgsql-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

pgsql-bugs by date:

Previous
From: jannevelink@anwb.nl
Date:
Subject: BUG #8244: Stack Builder 3.1.0 fails with an http proxy because of an incorrect HTTP Host header value
Next
From: Magnus Hagander
Date:
Subject: Re: BUG #8241: submisson