Re: Issue with custom operator in simple case - Mailing list pgsql-hackers

From Maxim Orlov
Subject Re: Issue with custom operator in simple case
Date
Msg-id CACG=eza6c=NiKJNgjqAwq-dgGHkZO-xB9Cg0okJ=koL6pe28AA@mail.gmail.com
Whole thread Raw
In response to Re: Issue with custom operator in simple case  (Maxim Orlov <orlovmg@gmail.com>)
List pgsql-hackers
AFAICS, we have the following problem constructions:
================================
a IS DISTINCT FROM b  
a IS NOT DISTINCT FROM b  
a IN (...)  
a NOT IN (...)  
CASE a WHEN b THEN ... ELSE d END  
NULLIF(a, b)  
JOIN USING / NATURAL JOIN 
================================

As a quick recap, the following options are available to us.
1) Add the "USING operator" clause.
Rejected due to:
* Non-standard syntax.
* ruleutils.c could not safely convert this back to the source text.
* In case "IS DISTINCT FROM" on composite types, using only the eq operator is maybe not enough.

2) Using default btree opclass/opfamily operators.
Rejected due to:
 * Adding yet another way of selecting an operator to the existingfunc_select_candidate and opfamily 
   seems too complicated and not safe.
 * May not work in some cases.

3) CVE-2018-1058 revert.
Rejected due to obvious reasons. 

In my humble opinion, the best way to solve an issue is (1). Whether it's even worth it. Although it 
uses non-standard syntax, it does not break the existing one.

--
Best regards,
Maxim Orlov.

pgsql-hackers by date:

Previous
From: "DINESH NAIR"
Date:
Subject: Re: A concurrent VACUUM FULL?
Next
From: Sami Imseih
Date:
Subject: Re: pg_get_multixact_members not documented