Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...
Date
Msg-id 18176.1004403392@sss.pgh.pa.us
Whole thread Raw
In response to Re: Odd error in complex query (7.2): Sub-SELECT  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> At 14:36 29/10/01 -0500, Tom Lane wrote:
>> The expanded-out equivalent of the problem query is
>> select (select t1.n from t1 where t1.f1 = s1.f1a) as a from s1
>> group by 1;
>> which I believe is indeed illegal.

> Dec/RDB ... allows the query
> It also allows:
>     select (select t1.n from t1 where t1.f1 = s1.f1a) as a from s1
>        group by (select t1.n from t1 where t1.f1 = s1.f1a);
> with the same plan. Which does not, on the face of it, seem illegal to me.

Hmm.  Maybe the query is legal, and the problem is just one of an
incorrect check for ungrouped vars in subselects.  Need to think more.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Odd error in complex query (7.2): Sub-SELECT
Next
From: Tatsuo Ishii
Date:
Subject: Re: Regression error on unixware 7 and open unix 8