-
Notifications
You must be signed in to change notification settings - Fork 3k
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
When querying TIMESTAMP WITH TIMEZONE data the values should be presented to user in session timezone #13157
Comments
Reproduction scenario on the product test environment:
Given that the user set the session time zone to be 'Europe/Vienna' I find it logical as well that the results would be delivered at the session time zone and not at Investigated the issue through debugging |
More evidence of this discrepancy, in my mind.
|
The session time zone has no bearing on how From the SQL spec:
and
Also changing the time zone of a The mechanism prescribed by the SQL standard to produce that behavior is to use the SELECT value AT LOCAL
FROM t Unfortunately, Trino doesn't yet support that syntax. |
Is knowing the original disk time zone required? As I understood it postgres, as that's what I know well, store all time data in UTC and then does conversions as needed based on client settings. Thus postgres already lost the "original" timezone. As a user or client to the database I'd expect all timestamps with timezones to be displayed in session timezone unless explicitly requested. If I insert MDT timestamp data I'd expect the database to store all that in UTC and lose the original MDT. I'd expect results to firstly show the data with the current client timezone and secondly show it overridden with a conversion request(AT TIME ZONE, etc). From Postgres docs:
I can see both sides. It is more useful to me, and my team, to have essentially a global 'AT TIMEZONE' implied when using SET TIMEZONE or X-Trino-Time-Zone rather than every query have explicit conversions. We do have a running gag that Trino is NOT postgres. :) |
Correct. PostgreSQL's
That would create representability problems. Session time zone cannot unambiguously represent certain points in time when there is a backward DST change (or some other, irregular timezone offset adjustment). See eg #5488 for a case where we explicitly switched a connector from using session zone to fixed UTC zone. Let me close this issue as answered. |
running docker version 389
timestamps in timestamp with timezone(timestamp(6) with time zone).
I see this in #37 closed which mentions : When querying TIMESTAMP WITH TIMEZONE data the values are presented to user in session timezone
Expected Behavior:
When querying TIMESTAMP WITH TIMEZONE data the values are presented to user in session timezone
Actual Behavior
Results are show in imported timezone(UTC) regardless of client timezone
Examples:
With the timezone of the client set to UTC
Client Timezone set to America/Denver
Result in UTC not America/Denver.
The text was updated successfully, but these errors were encountered: