From: valgog@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8830: Query with a subquery failes to execute if this subquery does not contain references to own table
Date: Tue, 14 Jan 2014 10:32:19 +0000
Message-ID: <20140114103219.30126.61565@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 8830
Logged by: Query with a subquery failes to execute if a subquery does not contain
references to inner table
Email address: valgog@gmail.com
PostgreSQL version: 9.3.2
Operating system: Linux
Description:
select 'key.' || md5( s.i::text ) as key,
'value.' || ( select string_agg( md5( (s.i + g.j)::text), '' )
from generate_series(1, 10) as g(j)
) as value
from generate_series(1, 100) as s(i);
works fine.
select 'key.' || md5( s.i::text ) as key,
'value.' || ( select string_agg( md5( (s.i)::text), '' )
from generate_series(1, 20) as g(j)
) as value
from generate_series(1, 100) as s(i);
fails with:
ERROR: column "s.i" must appear in the GROUP BY clause or be used in an
aggregate function
LINE 2: select 'key.' || md5( s.i::text ) as key,
Is it a bug or a feature?
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: valgog@gmail.com
Subject: Re: BUG #8830: Query with a subquery failes to execute if this subquery does not contain references to own table
In-Reply-To: <20140114103219.30126.61565@wrigleys.postgresql.org>
References: <20140114103219.30126.61565@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