Robert Haas <robertmh...@gmail.com> writes: > I agree that it doesn't follow in general. I think it does in the case > of timestamp and timestamptz, because I don't think either the choice > of time zone or the fact that we're reckoning relative to a time zone > can change which of two timestamps is considered earlier. However, I > think the only infrastructure we have for proving that is to look to > see whether it's the same operator family in both cases. Because > timestamp_ops and timestamptz_ops are separate, that doesn't help > here.
Right. It would in fact work for these two types, but we do not have infrastructure that would allow us to know that. I'm not sure about your idea that "same operator family" is enough. (Even for these two types, while a plain btree index should be fine, I think it wouldn't be hard to construct expression indexes that would not be compatible. So there's a lot of worms in that can.) regards, tom lane