Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cF2rr-0006zr-0k for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Dec 2016 17:52:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cF2rq-0004Iq-JK for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Dec 2016 17:52:26 +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.84_2) (envelope-from ) id 1cF2qS-0002hq-PG for pgsql-hackers@postgresql.org; Thu, 08 Dec 2016 17:51:00 +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.84_2) (envelope-from ) id 1cF2qL-00008i-No for pgsql-hackers@postgresql.org; Thu, 08 Dec 2016 17:51:00 +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 uB8HooYN006320; Thu, 8 Dec 2016 12:50:50 -0500 From: Tom Lane To: Jeff Janes cc: pgsql-hackers Subject: Re: postgres_fdw bug in 9.6 In-reply-to: References: Comments: In-reply-to Jeff Janes message dated "Thu, 08 Dec 2016 09:07:19 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6318.1481219450.1@sss.pgh.pa.us> Date: Thu, 08 Dec 2016 12:50:50 -0500 Message-ID: <6319.1481219450@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) 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 Jeff Janes writes: > I have a DML statement which triggers the error: > ERROR: XX000: outer pathkeys do not match mergeclauses > LOCATION: create_mergejoin_plan, createplan.c:3722 Hmm. > Any tips on investigating this further in situ? Or is the best option just > to work harder on a minimal and disclosable test case? I think we need a test case --- not minimal necessarily, but something other people can reproduce. You might find that setting enable_hashjoin and/or enable_nestloop to false makes it easier to provoke the error, since evidently this requires that we (a) generate a faulty mergejoin Path and then (b) choose it as the cheapest one, since the error occurs while converting it to a Plan. BTW, if you're not doing this in a debug (--enable-cassert) build, it'd be useful to try it in one. I'm a little suspicious that the root cause might be a memory-stomp type of problem, ie somebody scribbling on a pathkey data structure without accounting for it being shared with another path. It's possible that cassert memory checking would help catch that. 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