-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[YSQL] Some of the timezone facts, as shown via pg_timezone_names, are out of date #8550
Comments
Here are some more differences between pg_timzone_names in PG 13.2 and YB 2.4. To see some of them, you need to look at the abbreviations for both Standard Time and Daylight Savings Time. You need this function do do that:
Now do this query in each env:
Here is the YB 2.4 result:
And here is the PG 13.2 result:
There are 14 rows. Each row is pairwise different. They were discovered by various ad hoc methods. You could test systematically by copying out the PG results to a file and copying them into a table called, say, PG_pg_timezone_names in YB. Then use Notice this Wikipedia article: Daylight saving time in Canada. It says this:
PosgreSQL ensures that the pg_timezone_names view is kept current with each successive release. YB must do the same. |
Jira Link: DB-2401
Using YB YB-2.4.0.0 on macOS Version 11.3.1 .
Some of the timezone facts, as shown via pg_timezone_names, are out of date w.r.t what this shows:
I did a simple copy-and-paste from the browser view of this data and used the
\copy
command in ysqlsh to ingest it to table stage. The unique timezone names that fall outside the intersection of stage and pg_timezone_names is tiny. (Each relation has about 600 rows. )has this result:
And the opposite:
Has this result:
So I joined pg_timezone_names to stage using name to populate the table extended_pg_timezone_names. This allows interesting queries that the shipped pg_timezone_names doesn't support.
I did this:
(std_offset is the offset from UTC when Daylight Savings Time is not in force. And dst_offset is the offset from UTC when it is in force.)
This is the result:
However, in Vanilla PG Version 13.2, the query gets no rows. As I understand it, the timezone facts are linked into the PG executable—or at least are accessible in its env for it to read when needed. Obviously, these facts have been updated between 11.2 and 13.2. Who knows if it was a bug in 11.2 or if these three timezones changed their rules. That doesn't matter.
YB needs to remain current with data like this.
I've attached my code kit. It's trivial. Just start copy-from-tz-database.sql at the ysqlsh prompt. You'll see what I report here.
ingest-tz-database-timezones.zip
The text was updated successfully, but these errors were encountered: