Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCCNY-0002iP-8T for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Nov 2017 22:29:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCCNX-0005k1-6L for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Nov 2017 22:29:55 +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 1eCCNW-0005jM-BE for pgsql-bugs@postgresql.org; Tue, 07 Nov 2017 22:29:54 +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 1eCCNP-0006UU-3Q for pgsql-bugs@postgresql.org; Tue, 07 Nov 2017 22:29:53 +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 vA7MTf3i010661; Tue, 7 Nov 2017 17:29:41 -0500 From: Tom Lane To: sean.johnston@edgeintelligence.com cc: pgsql-bugs@postgresql.org, Robert Haas , Jeevan Chalke , Ashutosh Bapat Subject: Re: BUG #14890: Error grouping by same column twice using FDW In-reply-to: <20171107134948.1508.94783@wrigleys.postgresql.org> References: <20171107134948.1508.94783@wrigleys.postgresql.org> Comments: In-reply-to sean.johnston@edgeintelligence.com message dated "Tue, 07 Nov 2017 13:49:48 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10659.1510093781.1@sss.pgh.pa.us> Date: Tue, 07 Nov 2017 17:29:41 -0500 Message-ID: <10660.1510093781@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org sean.johnston@edgeintelligence.com writes: > select col1, col1 from loop_tbl group by 1, 2; > psql:t.sql:7: ERROR: targetlist item has multiple sortgroupref labels This is the fault of commit 7012b132d ("Push down aggregates to remote servers"), which imagined that postgres_fdw can use apply_pathtarget_labeling_to_tlist() for situations well beyond that function's limited abilities. I kinda suspect that foreign_grouping_ok() has got more bugs than this with complicated sortgroupref situations, too; its willingness to scribble on the sortgrouprefs doesn't look like a great idea to me. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs