postgres_fdw bug in 9.6 - Mailing list pgsql-hackers

From Jeff Janes
Subject postgres_fdw bug in 9.6
Date
Msg-id CAMkU=1y2G8VOVBHv3iXU2TMAj7-RyBFFW1uhkr5sm9LQ2=X35g@mail.gmail.com
Whole thread Raw
Responses Re: postgres_fdw bug in 9.6  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I have a setup where a 9.6.1 server uses postgres_fdw to connect to a 9.4.9 hot standby server.

I have a DML statement which triggers the error:

ERROR:  XX000: outer pathkeys do not match mergeclauses
LOCATION:  create_mergejoin_plan, createplan.c:3722

The error first starts appearing with this commit (on the local side): 

commit aa09cd242fa7e3a694a31f8aed521e80d1e626a4
Author: Robert Haas <rhaas@postgresql.org>
Date:   Wed Mar 9 10:51:49 2016 -0500

    postgres_fdw: Consider foreign joining and foreign sorting together.

 
The version of the remote side does not seem to matter.  I've also promoted a test instance of the remote from hot standby to master and then upgraded to 9.6.1, and neither step fixes the issue.

The statement is like this:

explain update foo_local set col3=foo_remote.col3 from foo_remote where foo_local.id=foo_remote.id and foo_local.id in ('aaa','bbb','ccc','ddd');

Where foo_remote is a pretty complicated view (defined locally) over the join of 8 foreign tables.

I am having trouble producing a self-contained, disclosable test case for this.  Small changes causes the error to go away.  On the local side, it doesn't seem to depend on the contents of the table, only the structure.  But on the remote side, truncating the central table for the query makes the error go away.

Any tips on investigating this further in situ?  Or is the best option just to work harder on a minimal and disclosable test case?

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Refactor "if(strspn(str, ...) == strlen(str)" code
Next
From: Ashutosh Sharma
Date:
Subject: Re: Hang in pldebugger after git commit : 98a64d0