Re: BUG #8242: No way to debug "subquery must return only one column" error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: boraldomaster(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8242: No way to debug "subquery must return only one column" error
Date: 2013-06-20 19:28:33
Message-ID: 24774.1371756513@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

boraldomaster(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandeep Thakkar 2013-06-21 07:11:12 Re: Re: [BUGS] Sorry to bother you. Please tell me exactly how the compiler was built ODBC
Previous Message jannevelink 2013-06-20 16:47:04 BUG #8244: Stack Builder 3.1.0 fails with an http proxy because of an incorrect HTTP Host header value