Bruno Wolff III <[EMAIL PROTECTED]> writes: > I went back and reread the stuff on NEGATOR and found it only applies > to operators that return boolean types. I had thought it was different > and would let you make the deduction a > b <=> -a <= -b, but that isn't > the case. Instead it lets you make the deduction that a > b <=> NOT (a <= b).
Right, the reason NEGATOR exists is to let prepqual.c flatten out NOTs where possible (this is the same part of the code that applies DeMorgan's Laws and other boolean algebra to try to bring a qual condition into the simplest possible form). To do something useful with "-" and descending order, we'd need some way of explicitly associating "-" operators with btree opclasses. I'm not convinced that it's worth the trouble, especially when it'd really only apply to the numeric datatypes ("-" on text is a pretty unappealing concept...). Stephan's suggestion of providing standard reverse-order opclasses seems more attractive to me. Even if people didn't want to put them into the mainstream, they could be consed up as a contrib module with not a lot of effort. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly