Sergey Shinderuk <s.shinde...@postgrespro.ru> writes: > What about user-defined operators? I created my own <= operator for int8 > which returns true on null input, and put it in a btree operator class. > Admittedly, it's weird that (null <= 1) evaluates to true. But does it > violate the contract of the btree operator class or something? Didn't > find a clear answer in the docs.
It's pretty unlikely that this would work during an actual index scan. I'm fairly sure that btree (and other index AMs) have hard-wired assumptions that index operators are strict. regards, tom lane