Re: ORDER/GROUP BY expression not found in targetlist

From: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: ORDER/GROUP BY expression not found in targetlist
Date: 2016-05-26 14:07:59
Message-ID: 87a8jcoqtc.fsf@elite.ansel.ydns.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Geoghegan writes:

> On Wed, May 25, 2016 at 7:12 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>>
>> =# CREATE TABLE twocol(col01 int, col02 int);
>> =# SELECT DISTINCT col01, col02, col01 FROM twocol ;
>> ERROR: XX000: ORDER/GROUP BY expression not found in targetlist
>> LOCATION: get_sortgroupref_tle, tlist.c:341
>>
>> which appears to be a 9.6 regression, presumable fallout from the path
>> restructuring.
>
> It's surprising that SQL Smith didn't catch something with such simple
> steps to reproduce.

I removed distinct relatively early because it causes a large part of
queries to fail due to it not finding an equality operator it likes. It
seems to be more picky about the equality operator than, say, joins.
I'm sure it has a good reason to do so?

regression=> select distinct f1 from path_tbl;
ERROR: could not identify an equality operator for type path
LINE 1: select distinct f1 from path_tbl;

regression=> \do =
-[ RECORD 38 ]-+----------------------------
Schema | pg_catalog
Name | =
Left arg type | path
Right arg type | path
Result type | boolean
Description | equal

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-05-26 14:12:55 Re: ORDER/GROUP BY expression not found in targetlist
Previous Message Tom Lane 2016-05-26 14:05:56 Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet