Philip Warner <pjw(at)rhyme(dot)com(dot)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