Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: timezones after 2038 use incorrect DST settings #45001

Closed
otan opened this issue Feb 12, 2020 · 2 comments
Closed

sql: timezones after 2038 use incorrect DST settings #45001

otan opened this issue Feb 12, 2020 · 2 comments
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@otan
Copy link
Contributor

otan commented Feb 12, 2020

Cockroach stops propagating DST after 2037:

[email protected]:57882/defaultdb> SET TIME ZONE 'America/Chicago';

[email protected]:57882/defaultdb> select '2038-09-06 04:15:30.746999-06:00'::timestamptz;
            timestamptz
------------------------------------
  2038-09-06 04:15:30.746999-06:00
(1 row)

Time: 321µs

[email protected]:57882/defaultdb> select '2037-09-06 04:15:30.746999-06:00'::timestamptz;
            timestamptz
------------------------------------
  2037-09-06 05:15:30.746999-05:00
(1 row)

Time: 399µs

Compared to postgres:

otan=# set time zone 'America/Chicago';
SET
otan=# select '2038-09-06 04:15:30.746999-06:00'::timestamptz;
          timestamptz
-------------------------------
 2038-09-06 05:15:30.746999-05
(1 row)

otan=#  select '2037-09-06 04:15:30.746999-06:00'::timestamptz;
          timestamptz
-------------------------------
 2037-09-06 05:15:30.746999-05
(1 row)

This is actually not resolvable after #36864 since it is the parsing of golang's time data does not consider "extended" information, and in order to use In, we have to give a time.Location which is a private struct which can only be made internally in the time.Location package.

This will be addressed in Golang by golang/go#36654, but requires a cockroach golang upgrade after the fix for this issue is merged in.

Jira issue: CRDB-5185

@otan otan changed the title timezones after 2038 use incorrect DST settings sql: timezones after 2038 use incorrect DST settings Feb 12, 2020
@otan otan added A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Feb 12, 2020
@otan
Copy link
Contributor Author

otan commented May 8, 2020

looks like go has submitted a fix in -- now it's a matter of that patch being available in the next Go version we use.

@otan
Copy link
Contributor Author

otan commented Apr 12, 2022

upgraded go version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

No branches or pull requests

2 participants