"Dennis Vshivkov" <walrus(at)amur(dot)ru> writes:
> [8.0.1|src/backend/utils/adt/date.c] timetz_cmp_internal():
> /* Primary sort is by true (GMT-equivalent) time */
> t1 = time1->time + time1->zone;
> t2 = time2->time + time2->zone;
> This code is only valid when HAVE_INT64_TIMESTAMP is NOT the case.
Fixed, thanks for the report.
Note that this fix will invalidate any existing indexes on TIMETZ
columns in --enable-integer-datetimes installations; they'll have
to be REINDEXed after application of the patch. I suspect such
indexes are pretty few and far between, so I went ahead and back-patched
the fix into back branches despite the risk of incompatibility.
regards, tom lane