pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: andrew@tao11.riddles.org.uk
To: pgsql-bugs@postgresql.org
Subject: BUG #7622: Incorrect aggregate level processing
Date: Fri, 26 Oct 2012 05:20:31 +0000
Message-ID: <E1TRcLP-0008GF-Sp@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7622
Logged by:          Andrew Gierth
Email address:      andrew@tao11.riddles.org.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.)





view thread (2+ messages)  latest in thread

Message-ID: <E1TRcLP-0008GF-Sp@wrigleys.postgresql.org>
Permalink:  ../E1TRcLP-0008GF-Sp@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1TRcLP-0008GF-Sp@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk
  Subject: Re: BUG #7622: Incorrect aggregate level processing
  In-Reply-To: <E1TRcLP-0008GF-Sp@wrigleys.postgresql.org>
  References: <E1TRcLP-0008GF-Sp@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox