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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Odd error in complex query (7.2): Sub-SELECT uses un-GROUPed...
Date: 2001-10-30 00:56:32
Message-ID: 18176.1004403392@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-10-30 01:01:19 Re: Regression error on unixware 7 and open unix 8
Previous Message Philip Warner 2001-10-30 00:49:28 Re: Odd error in complex query (7.2): Sub-SELECT