Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVfWn-0002WP-EL for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jun 2018 16:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVfWm-0002FT-1I for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jun 2018 16:00:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVfWl-0002FI-QY for pgsql-hackers@lists.postgresql.org; Wed, 20 Jun 2018 16:00:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVfWe-0004P3-Hi for pgsql-hackers@postgresql.org; Wed, 20 Jun 2018 16:00:11 +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 w5KFxvgx020181; Wed, 20 Jun 2018 11:59:57 -0400 From: Tom Lane To: Rajkumar Raghuwanshi cc: pgsql-hackers , Andres Freund Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist In-reply-to: References: Comments: In-reply-to Rajkumar Raghuwanshi message dated "Wed, 20 Jun 2018 13:22:26 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20179.1529510397.1@sss.pgh.pa.us> Date: Wed, 20 Jun 2018 11:59:57 -0400 Message-ID: <20180.1529510397@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Rajkumar Raghuwanshi writes: > Below test case is failing with ERROR: ORDER/GROUP BY expression not found > in targetlist. this issue is reproducible from PGv10. Thanks for the report. I traced through this, and the problem seems to be that split_pathtarget_at_srfs() is neglecting to attach sortgroupref labeling to the extra PathTargets it constructs. I don't remember whether that code is my fault or Andres', but I'll take a look at fixing it. regards, tom lane