Inconsistency between try_mergejoin_path and create_mergejoin_plan - Mailing list pgsql-hackers

From Alexander Pyhalov
Subject Inconsistency between try_mergejoin_path and create_mergejoin_plan
Date
Msg-id c59ec04a2fef94d9ffc35a9b17dfc081@postgrespro.ru
Whole thread Raw
Responses Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan
List pgsql-hackers
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
Attachment

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Direct SSL connection and ALPN loose ends
Next
From: Melanie Plageman
Date:
Subject: Re: Show WAL write and fsync stats in pg_stat_io