Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCSkM-0003nR-C8 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 14:21:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCSkL-0003R5-QG for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 14:21:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCSkK-0003QE-Cl for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 14:21:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCSkH-0002hj-Ur for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 14:21:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5DELZDv015696; Mon, 13 Jun 2016 10:21:35 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , David Rowley , Thomas Munro , Amit Kapila , Pg Hackers Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Mon, 13 Jun 2016 09:47:46 -0400" Date: Mon, 13 Jun 2016 10:21:35 -0400 Message-ID: <15695.1465827695@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Mon, Jun 13, 2016 at 3:18 AM, Amit Kapila wrote: >> 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. > It doesn't seem like a good idea to destructive modify > input_rel->partial_pathlist. Applying the projection to each path > before using it would probably be better. I think the real question here is why the code removed by 04ae11f62 was wrong. It was unsafe to use apply_projection_to_path, certainly, but using create_projection_path directly would have avoided the stated problem. And it's very unclear that this new patch doesn't bring back that bug in a different place. I am not very happy that neither 04ae11f62 nor this patch include any regression test case proving that a problem existed and has been fixed. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers