Martijn van Oosterhout <kleptog@svana.org> writes:
> I've been think about adding IS (NOT) NULL type clauses and it doesn't look
> too hard but I wonder if my logic is right.
I think all you need is to add the correct implication rules to
indxpath.c. Let's see:
IS NULL => IS NULL
IS NOT NULL => IS NOT NULL
IS TRUE => IS TRUE
IS TRUE => IS NOT FALSE (but not vice versa)
IS TRUE => IS NOT UNKNOWN (but not vice versa)
IS NOT TRUE => IS NOT TRUE
and similarly to the last four for IS FALSE and IS UNKNOWN. No?
BTW, it might be a good idea to split out the implication code into a
new file, probably in optimizer/prep or optimizer/utils, rather than
letting it continue to grow where it is. Doesn't seem like it belongs
in indxpath.c.
regards, tom lane