=== Applying patches on top of PostgreSQL commit ID 57926d757ab43852021d917b6221687a341c8385 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Oct 16 11:59:27 UTC 2026 On branch cf/7447 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-btree_gin-Fix-timestamptz-lower-bound-in-repeated.patch === Applying: btree_gin: Fix timestamptz lower bound in repeated DST hour. Using index info to reconstruct a base tree... M contrib/btree_gin/btree_gin.c Falling back to patching base and 3-way merge... Auto-merging contrib/btree_gin/btree_gin.c CONFLICT (content): Merge conflict in contrib/btree_gin/btree_gin.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 btree_gin: Fix timestamptz lower bound in repeated DST hour. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v2-0001-btree_gin-Fix-timestamptz-lower-bound-in-repeated.patch === patching file contrib/btree_gin/btree_gin.c Hunk #1 succeeded at 501 with fuzz 2 (offset -12 lines). [cf/7447 6b49bee6fef] btree_gin: Fix timestamptz lower bound in repeated DST hour. Author: shihao zhong Date: Mon Oct 12 03:09:18 2026 -0400 1 file changed, 9 insertions(+) === using 'git am' to apply patch ./v2-0002-btree_gin-Test-timestamptz-bound-in-repeated-DST-.patch === Applying: btree_gin: Test timestamptz bound in repeated DST hour. Using index info to reconstruct a base tree... M contrib/btree_gin/expected/timestamp.out M contrib/btree_gin/sql/timestamp.sql Falling back to patching base and 3-way merge... Auto-merging contrib/btree_gin/sql/timestamp.sql CONFLICT (content): Merge conflict in contrib/btree_gin/sql/timestamp.sql Auto-merging contrib/btree_gin/expected/timestamp.out CONFLICT (content): Merge conflict in contrib/btree_gin/expected/timestamp.out error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 btree_gin: Test timestamptz bound in repeated DST hour. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v2-0002-btree_gin-Test-timestamptz-bound-in-repeated-DST-.patch === patching file contrib/btree_gin/expected/timestamp.out Hunk #1 FAILED at 343. 1 out of 1 hunk FAILED -- saving rejects to file contrib/btree_gin/expected/timestamp.out.rej patching file contrib/btree_gin/sql/timestamp.sql Hunk #1 FAILED at 71. 1 out of 1 hunk FAILED -- saving rejects to file contrib/btree_gin/sql/timestamp.sql.rej Removing contrib/btree_gin/expected/timestamp.out.rej Removing contrib/btree_gin/sql/timestamp.sql.rej === using 'git apply' to apply patch ./v2-0002-btree_gin-Test-timestamptz-bound-in-repeated-DST-.patch === Applied patch to 'contrib/btree_gin/expected/timestamp.out' with conflicts. Applied patch to 'contrib/btree_gin/sql/timestamp.sql' with conflicts. U contrib/btree_gin/expected/timestamp.out U contrib/btree_gin/sql/timestamp.sql diff --cc contrib/btree_gin/expected/timestamp.out index 6e972b56602,2e8fa5a420a..00000000000 --- a/contrib/btree_gin/expected/timestamp.out +++ b/contrib/btree_gin/expected/timestamp.out @@@ -343,29 -343,31 +343,52 @@@ SELECT * FROM test_timestamp WHERE i>'4 infinity (7 rows) ++<<<<<<< ours +-- Check that we aren't fooled by ambiguous timestamps near a DST transition +INSERT INTO test_timestamp VALUES + ('2026-11-01 00:50'), ('2026-11-01 01:10'), ('2026-11-01 01:20'), + ('2026-11-01 01:40'), ('2026-11-01 02:10'); +SET TimeZone = 'America/New_York'; +SELECT * FROM test_timestamp WHERE i>='2026-11-01 01:30-04'::timestamptz ORDER BY i; ++======= + -- Repeated hour at the end of DST must not hide rows from the index scan + SET TimeZone = 'America/New_York'; + CREATE TABLE test_timestamp_dst (i timestamp); + INSERT INTO test_timestamp_dst VALUES + ('2026-11-01 00:50'), ('2026-11-01 01:10'), ('2026-11-01 01:20'), + ('2026-11-01 01:40'), ('2026-11-01 02:10'); + CREATE INDEX idx_timestamp_dst ON test_timestamp_dst USING gin (i); + SELECT * FROM test_timestamp_dst + WHERE i >= '2026-11-01 01:30-04'::timestamptz ORDER BY i; ++>>>>>>> theirs i -------------------------- Sun Nov 01 01:10:00 2026 Sun Nov 01 01:20:00 2026 Sun Nov 01 01:40:00 2026 Sun Nov 01 02:10:00 2026 ++<<<<<<< ours + infinity +(5 rows) + +SELECT * FROM test_timestamp WHERE i>'2026-11-01 01:30-04'::timestamptz ORDER BY i; ++======= + (4 rows) + + SELECT * FROM test_timestamp_dst + WHERE i > '2026-11-01 01:30-04'::timestamptz ORDER BY i; ++>>>>>>> theirs i -------------------------- Sun Nov 01 01:10:00 2026 Sun Nov 01 01:20:00 2026 Sun Nov 01 01:40:00 2026 Sun Nov 01 02:10:00 2026 ++<<<<<<< ours + infinity +(5 rows) ++======= + (4 rows) ++>>>>>>> theirs RESET TimeZone; diff --cc contrib/btree_gin/sql/timestamp.sql index 750ab6d2336,23a8b11de00..00000000000 --- a/contrib/btree_gin/sql/timestamp.sql +++ b/contrib/btree_gin/sql/timestamp.sql @@@ -72,11 -72,15 +72,25 @@@ SELECT * FROM test_timestamp WHERE i>'i SELECT * FROM test_timestamp WHERE i<='4714-11-23 17:00 BC'::timestamptz ORDER BY i; SELECT * FROM test_timestamp WHERE i>'4714-11-23 17:00 BC'::timestamptz ORDER BY i; ++<<<<<<< ours +-- Check that we aren't fooled by ambiguous timestamps near a DST transition +INSERT INTO test_timestamp VALUES + ('2026-11-01 00:50'), ('2026-11-01 01:10'), ('2026-11-01 01:20'), + ('2026-11-01 01:40'), ('2026-11-01 02:10'); +SET TimeZone = 'America/New_York'; +SELECT * FROM test_timestamp WHERE i>='2026-11-01 01:30-04'::timestamptz ORDER BY i; +SELECT * FROM test_timestamp WHERE i>'2026-11-01 01:30-04'::timestamptz ORDER BY i; ++======= + -- Repeated hour at the end of DST must not hide rows from the index scan + SET TimeZone = 'America/New_York'; + CREATE TABLE test_timestamp_dst (i timestamp); + INSERT INTO test_timestamp_dst VALUES + ('2026-11-01 00:50'), ('2026-11-01 01:10'), ('2026-11-01 01:20'), + ('2026-11-01 01:40'), ('2026-11-01 02:10'); + CREATE INDEX idx_timestamp_dst ON test_timestamp_dst USING gin (i); + SELECT * FROM test_timestamp_dst + WHERE i >= '2026-11-01 01:30-04'::timestamptz ORDER BY i; + SELECT * FROM test_timestamp_dst + WHERE i > '2026-11-01 01:30-04'::timestamptz ORDER BY i; ++>>>>>>> theirs RESET TimeZone;