Hi.
There's the following inconsistency between try_mergejoin_path() and
create_mergejoin_plan().
When clause operator has no commutator, we can end up with mergejoin
path.
Later create_mergejoin_plan() will call get_switched_clauses(). This
function can error out with
ERROR: could not find commutator for operator XXX
The similar behavior seems to be present also for hash join.
Attaching a test case (in patch) and a possible fix.
--
Best regards,
Alexander Pyhalov,
Postgres Professional