Hi Tom, I think that's assuming way too much about the behavior of the > timezone code. I'd be inclined to use logic more along the line > of "compare to the original value using the relevant comparison > function; if greater, subtract an hour and try again".
Done in v2. cvt_timestamptz_timestamp now moves the key back an hour while timestamp_cmp_timestamptz_internal() says it is later than the bound. > Also, doesn't cvt_timestamptz_date have the same issue? I could not make it fail in a test over every backward clock change in tzdata, and the code agrees. The key is the local date of the bound. An earlier date can only compare as later than the bound if the clock goes back by more than a whole day. The biggest step back in tzdata is exactly 24 hours, Alaska in 1867. If you'd rather not rely on that, the same loop with result-- works there and I can add it. Thanks, Shihao
v2-0001-btree_gin-Fix-timestamptz-lower-bound-in-repeated.patch
Description: Binary data
v2-0002-btree_gin-Test-timestamptz-bound-in-repeated-DST-.patch
Description: Binary data
