0

I installed Postgresql 9.5.3 on windows, and picked "default locale" during the installation.

I believe that this has made my system TimeZone parameter default to my local timezone. I know that I can manually set the time zone using set timezone: How to set timezone for Postgres psql?

However, I would like my system TimeZone parameter to be the 'UTC' time zone, without having to set it manually. I looked up my postgresql.conf and replaced the timezone = ... line with timezone = 'UTC', per this link, but this does not seem to have worked.

10
  • I think you misunderstand how timestamp with time zone works. The timestamp is always stored without a time zone on the server. When retrieving the data, the timestamp is adjusted to the client's time zone. postgresql.org/docs/current/static/… Commented Jul 14, 2016 at 6:19
  • Ok, but how come the statement insert into table_name (date_col) Values ('2015-01-01 00:00:00') results in something different depending on what the time zone of the database has been set to, and what does set timezone do then? Commented Jul 14, 2016 at 6:34
  • ok, reading the link this is I am guessing the relevant bit: An input value that has an explicit time zone specified is converted to UTC using the appropriate offset for that time zone. If no time zone is stated in the input string, then it is assumed to be in the time zone indicated by the system's TimeZone parameter, and is converted to UTC using the offset for the timezone zone. Commented Jul 14, 2016 at 6:37
  • I have edited my question, hopefully the premise of the question is correct now Commented Jul 14, 2016 at 6:39
  • what "does not seem to have worked"?.. how you see that? Commented Jul 14, 2016 at 7:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.