Re: [HACKERS] ARRAY(subquery) volatility

2005-08-16 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Why does the first query below return the same value for each row > while the second query returns random values? Planner optimization? > test=> SELECT ARRAY(SELECT random()) FROM generate_series(1, 5); > test=> SELECT ARRAY(SELECT random() + x * 0) FROM

Re: [HACKERS] ARRAY(subquery) volatility

2005-08-16 Thread Joe Conway
Michael Fuhr wrote: Why does the first query below return the same value for each row while the second query returns random values? Planner optimization? I assume it is due to some kind of flattening in the planner, but it is totally unrelated to ARRAY(subquery): regression=# SELECT (SELECT