Re: [SQL] Set generating functions and subqueries

2006-03-13 Thread Tom Lane
Markus Schaber <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> The fact that the other form is even allowed is more of a holdover from >> PostQUEL than something we have consciously decided is a good idea. >> (IMHO it's actually a fairly *bad* idea, because it does not work nicely >> when there's

Re: [SQL] Set generating functions and subqueries

2006-03-13 Thread Markus Schaber
Hi, Tom, Tom Lane wrote: > The behavior of the subquery expression is dictated by the SQL spec: > > 1) If the cardinality of a or a is > greater than 1, then an exception condition is raised: cardinal- > ity violation. That's interesting to know, and it seems

Re: [SQL] Set generating functions and subqueries

2006-03-10 Thread Tom Lane
Markus Schaber <[EMAIL PROTECTED]> writes: > postgres=# select (select generate_series(1,2)),'othercol'; > ERROR: more than one row returned by a subquery used as an expression > So it seems that set-returning functions "blow up" the resultset by > duplicating rows - so why is this not allowed fo

[SQL] Set generating functions and subqueries

2006-03-10 Thread Markus Schaber
Hello, Today, I stumbled across the following: postgres=# select generate_series(1,2),'othercol'; generate_series | ?column? -+-- 1 | othercol 2 | othercol (2 rows) postgres=# select (select generate_series(1,2)),'othercol'; ERROR: more tha