Re: ERROR: ORDER/GROUP BY expression not found in targetlist

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist
Date: 2016-06-13 07:18:17
Message-ID: CAA4eK1Jm6HrJAPX26xyLGWes++r5=dOyOGRWeTa4q8NKd-UhVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 13, 2016 at 11:05 AM, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
wrote:
>
> On 13 June 2016 at 15:39, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
wrote:
> > What is going on here?
>
> ...
>
> >
> > postgres=# set max_parallel_workers_per_gather = 2;
> > SET
> > postgres=# explain select length(data) from logs group by length(data);
> > ERROR: ORDER/GROUP BY expression not found in targetlist
>
> Seems like this was caused by 04ae11f62e643e07c411c4935ea6af46cb112aa9
>

In create_grouping_paths(), we are building partial_grouping_path and same
is used for gather path and other grouping paths (for partial paths).
However, we don't use it for partial path list and sort path due to which
path target for Sort path is different from what we have expected. Is
there a problem in applying partial_grouping_path for partial pathlist?
Attached patch just does that and I don't see error with patch.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
apply_partial_pathtarget_partial_pathlist_v1.patch application/octet-stream 817 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-06-13 07:23:41 proposal: integration bloat tables (indexes) to core
Previous Message Michael Paquier 2016-06-13 06:52:08 Re: ERROR: ORDER/GROUP BY expression not found in targetlist