Allow setting of time zone per connection

Right now when I connect to a Postgres database the connection, and all queries run under my current time zone. However because the database runs under UTC, and my locale is not UTC this causes all sorts of headaches and mistakes when working with timestamps with timezones columns.

The simple work around I have for the moment is to have a SET TIME ZONE 'UTC'; before every single SQL to guarantee the execution runs correctly under that (re)connection.

Therefore I would suggest the option in the connection configuration of choosing a different time zone/locale that the connection (and reconnections if they occur, as I suspect they do) run under. n.b. I think it is more logical on the connection configuration than it would be as an application wide configuration.

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi. This already exists. Edit your postgres connection and choose ‘advanced’ New the bottom right (above the save button), then general (I think — sorry I’m away from my Mac so I’m not 100% sure the second level menu item). From here there is an option to set the time zone which only affects that connection.

    • Kyle Hankinson dang you are right, I must've been looking at the wrong connection type, sorry.

    • Hi Kyle Hankinson, I tried this however it seems the setting doesn't save. When I go back into the Advanced->ConnectionPreferences and change the Timezone and Accept and Save and return back to the setting it has returned to default

    • Paul Schaap I've fixed the timezone not being saved for the next build.

    • Kyle Hankinson I can confirm this is working beautifully in the latest Version 1.0.335 (Build 110335.1), Thank You ! 👍 

Like1 Follow
  • 1 yr agoLast active
  • 5Replies
  • 87Views
  • 2 Following