Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,12 @@ postgres-types = { git = "https://github.com/MaterializeInc/rust-postgres" }
postgres-openssl = { git = "https://github.com/MaterializeInc/rust-postgres" }
postgres_array = { git = "https://github.com/MaterializeInc/rust-postgres-array" }

# Upstream chrono-tz is unmaintained and stops at tzdata 2025b. The fork's
# `mz_changes` branch carries current IANA data only, no code changes. To bump
# tzdata, update the fork, then follow the bump ceremony documented in
# src/environmentd/tests/testdata/timezones/regenerate.sh.
chrono-tz = { git = "https://github.com/MaterializeInc/chrono-tz.git", rev = "5999cdd1b971694f834ec3467d11ef9147fc297c" }

# Waiting on https://github.com/MaterializeInc/serde-value/pull/35.
serde-value = { git = "https://github.com/MaterializeInc/serde-value.git" }

Expand Down
14 changes: 7 additions & 7 deletions src/environmentd/tests/testdata/timezones/names-2026-12-15.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Africa/Blantyre,CAT,02:00:00,f
Africa/Brazzaville,WAT,01:00:00,f
Africa/Bujumbura,CAT,02:00:00,f
Africa/Cairo,EET,02:00:00,f
Africa/Casablanca,+01,01:00:00,f
Africa/Casablanca,+00,00:00:00,f
Africa/Ceuta,CET,01:00:00,f
Africa/Conakry,GMT,00:00:00,f
Africa/Dakar,GMT,00:00:00,f
Africa/Dar_es_Salaam,EAT,03:00:00,f
Africa/Djibouti,EAT,03:00:00,f
Africa/Douala,WAT,01:00:00,f
Africa/El_Aaiun,+01,01:00:00,f
Africa/El_Aaiun,+00,00:00:00,f
Africa/Freetown,GMT,00:00:00,f
Africa/Gaborone,CAT,02:00:00,f
Africa/Harare,CAT,02:00:00,f
Expand Down Expand Up @@ -107,7 +107,7 @@ America/Dawson_Creek,MST,-07:00:00,f
America/Denver,MST,-07:00:00,f
America/Detroit,EST,-05:00:00,f
America/Dominica,AST,-04:00:00,f
America/Edmonton,MST,-07:00:00,f
America/Edmonton,CST,-06:00:00,f
America/Eirunepe,-05,-05:00:00,f
America/El_Salvador,CST,-06:00:00,f
America/Ensenada,PST,-08:00:00,f
Expand Down Expand Up @@ -215,12 +215,12 @@ America/Thunder_Bay,EST,-05:00:00,f
America/Tijuana,PST,-08:00:00,f
America/Toronto,EST,-05:00:00,f
America/Tortola,AST,-04:00:00,f
America/Vancouver,PST,-08:00:00,f
America/Vancouver,MST,-07:00:00,f
America/Virgin,AST,-04:00:00,f
America/Whitehorse,MST,-07:00:00,f
America/Winnipeg,CST,-06:00:00,f
America/Yakutat,AKST,-09:00:00,f
America/Yellowknife,MST,-07:00:00,f
America/Yellowknife,CST,-06:00:00,f
Antarctica/Casey,+08,08:00:00,f
Antarctica/Davis,+07,07:00:00,f
Antarctica/DumontDUrville,+10,10:00:00,f
Expand Down Expand Up @@ -375,9 +375,9 @@ Brazil/West,-04,-04:00:00,f
Canada/Atlantic,AST,-04:00:00,f
Canada/Central,CST,-06:00:00,f
Canada/Eastern,EST,-05:00:00,f
Canada/Mountain,MST,-07:00:00,f
Canada/Mountain,CST,-06:00:00,f
Canada/Newfoundland,NST,-03:30:00,f
Canada/Pacific,PST,-08:00:00,f
Canada/Pacific,MST,-07:00:00,f
Canada/Saskatchewan,CST,-06:00:00,f
Canada/Yukon,MST,-07:00:00,f
CET,CET,01:00:00,f
Expand Down
2 changes: 1 addition & 1 deletion src/environmentd/tests/testdata/timezones/regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set -euo pipefail

cd "$(dirname "$0")"

EXPECTED_TZDATA=2025b
EXPECTED_TZDATA=2026c
IMAGE=mz-timezone-snapshot

DATES=("$@")
Expand Down
57 changes: 57 additions & 0 deletions test/sqllogictest/timezone.slt
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,44 @@ SELECT timezone_offset('Asia/Almaty', '2026-07-15 00:00:00 UTC'), timezone_offse
(+05,05:00:00,00:00:00)
(EEST,02:00:00,01:00:00)

# Zones whose rules changed in tzdata 2025c through 2026c: Morocco moved to
# permanent +00 on 2026-09-20, Alberta and British Columbia abolished DST on
# their 2026 fall-back dates and keep the summer offset, and Moldova follows
# EU transition instants. Both Canadian zones now render a neighbouring
# region's standard-time abbreviation for their permanent offset.

statement ok
SET unsafe_new_transaction_wall_time = '2026-12-15 00:00:00 UTC';

query TTTT
SELECT * FROM pg_catalog.pg_timezone_names
WHERE name IN ('Africa/Casablanca', 'America/Edmonton', 'America/Vancouver', 'Europe/Chisinau')
ORDER BY name
----
Africa/Casablanca
+00
00:00:00
false
America/Edmonton
CST
-06:00:00
false
America/Vancouver
MST
-07:00:00
false
Europe/Chisinau
EET
02:00:00
false

query TTT
SELECT timezone_offset('Africa/Casablanca', '2026-09-21 00:00:00 UTC'), timezone_offset('America/Edmonton', '2026-11-15 00:00:00 UTC'), timezone_offset('America/Vancouver', '2026-11-15 00:00:00 UTC')
----
(+00,00:00:00,00:00:00)
(CST,-06:00:00,00:00:00)
(MST,-07:00:00,00:00:00)

# These pin historical rules: a timestamp from before a zone's rule change
# must resolve under the rules in force at that instant, not current rules.

Expand Down Expand Up @@ -385,3 +423,22 @@ query T
SELECT timezone_offset('Asia/Choibalsan', '1995-06-15 00:00:00 UTC')
----
(+09,08:00:00,01:00:00)

# Moldova has switched at the EU instant, 01:00 UTC, since 2022. Older data
# had it one hour earlier, so for one hour around each transition the two
# disagree. This asserts the current belief about the past. If a data update
# breaks it, IANA rewrote history.

query T
SELECT timezone_offset('Europe/Chisinau', '2023-03-26 00:30:00 UTC')
----
(EET,02:00:00,00:00:00)
Comment on lines +427 to +435

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add a similar test for America/Tijuana which retroactively updated DST


# Baja California observed DST in 1953 and 1961 through 1975, following
# California, where earlier data had none. This asserts the current belief
# about the past. If a data update breaks it, IANA rewrote history.

query T
SELECT timezone_offset('America/Tijuana', '1970-07-15 12:00:00 UTC')
----
(PDT,-08:00:00,01:00:00)
Loading