Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable
Дата
Msg-id 23921.1240624683@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable  (Daniel Grace <dgrace@wingsnw.com>)
Ответы Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Daniel Grace <dgrace@wingsnw.com> writes:
> On Fri, Apr 24, 2009 at 5:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Hmmm ... I guess something is getting confused about the level of query
>> nesting.  FWIW, you can avoid the bug in these two examples by omitting
>> the inner "SELECT" keyword, which is useless anyway.  Perhaps it is
>> needed in your real query though ...

> It's required in my case to force the aggregate function to evaluate its
> inputs in a set order.

Really?  Your example doesn't show that.

> SELECT
>     s.fid, c.flags, c.id, c.title, cs.ut_start, cs.ut_end, cr.full_name,
>     cal.title AS cancel_reason,
>     (SELECT GROUP_CONCAT((SELECT s2.fname FROM student AS s2 WHERE s2.id=
       ------
> s.id ORDER BY fname), '; ')) AS students,

I'm talking about the underlined SELECT, not the one inside the
aggregate.  AFAICS this one is totally useless.  If it were useful,
we'd likely have found this issue long ago ...

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Daniel Grace
Дата:
Сообщение: Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Query with aggregate over subselects fails with ERROR: plan should not reference subplan's variable