Re: BUG #1617: TIME WITH TIME ZONE comparison is partially broken - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1617: TIME WITH TIME ZONE comparison is partially broken
Date
Msg-id 23584.1114297042@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1617: TIME WITH TIME ZONE comparison is partially broken  ("Dennis Vshivkov" <walrus@amur.ru>)
List pgsql-bugs
"Dennis Vshivkov" <walrus@amur.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

pgsql-bugs by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1613: Installation flaw
Next
From: Tom Lane
Date:
Subject: Re: BUG #1618: EXTRACTing EPOCH from TIME WITH TIME ZONE is broken