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

FIX: Remove SESSION timezone from LAMP_ALL_RT Query #203

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

rymarczy
Copy link
Collaborator

@rymarczy rymarczy commented Dec 13, 2023

After consulting with the #tid-eningeering slack channel, this guide was provided (https://database.guide/how-at-time-zone-works-in-postgresql/) pointing me in the correct direction to make the LAMP_ALL_RT Query produced the same results no matter the SESSION timezone of the query runner.

Instantiating a new timestamp object at a specified timezone is done with the following:

TIMESTAMP WITHOUT TIME ZONE AT TIME ZONE '....'

Creation of the start_datetime and static_start_datetime fields was also streamlined, converting service_date directly to a timestamp object (without a time zone) and then add seconds from start_time or static_start_time using the postgres make_interval function.

This should conclude the timestamp and time zone adventures in the LAMP_ALL_RT query, for now...

@mzappitello
Copy link
Contributor

that is a nicer looking solution 🍰

@rymarczy rymarczy merged commit c0691be into main Dec 14, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants