Re: ERROR: left and right pathkeys do not match in mergejoin
Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
From: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-02-23T11:16:30Z
Lists: pgsql-hackers
Ah, I understand now. We can lie to the executor about the order, because when we are moving based on the second outer column, we have a stretch of equal values in the inner column, so we can consider them to be sorted whatever way we need. The patch applies cleanly, make check-world passes. In create_mergejoin_plan: * implied inner ordering is then "ORDER BY x, y, x", but the pathkey * drops the second sort by x as redundant, and this code must cope. -- should this read "the pathkey machinery drops"? -- Alexander Kuzmenkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Fix planner failures with overlapping mergejoin clauses in an outer join.
- f6dd08489c80 9.4.17 landed
- e7c02a54a486 9.6.8 landed
- c458970ad5ea 10.3 landed
- 9afd513df042 11.0 landed
- 7dc5f316fd48 9.5.12 landed
- 71a0d0c5aad2 9.3.22 landed