| From: | andrew(at)tao11(dot)riddles(dot)org(dot)uk |
|---|---|
| To: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | BUG #7622: Incorrect aggregate level processing |
| Date: | 2012-10-26 05:20:31 |
| Message-ID: | E1TRcLP-0008GF-Sp@wrigleys.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 7622
Logged by: Andrew Gierth
Email address: andrew(at)tao11(dot)riddles(dot)org(dot)uk
PostgreSQL version: 9.2.1
Operating system: n/a
Description:
Tested on git-master, 9.2.1, various older versions.
select (select array_agg(random()*i) from (values (1),(2)) v(a)) from
generate_series(1,3) i;
Expected output is three rows each with a 2-element array; actual output
is:
ERROR: more than one row returned by a subquery used as an expression
Looking at the explain, the aggregate is being pulled out of the subplan and
evaluated at the top query level. (This came up while doing some random data
generation, I've simplified it a bit.)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Владимир Сошенко | 2012-10-26 12:37:09 | Installation issue |
| Previous Message | Dmitrijs Ledkovs | 2012-10-25 10:45:01 | Fails to build from source with multiarched python3.3 on Debian-like systems |