2

I have an application heavily relying upon timezones, and I am using PostgreSQL for storing and querying my data. I'm letting the user choosing their own timezone, by showing the list of postgresql's supported timezones, in their extensive form (i.e. Europe/Rome). All the information concerning time/date are crunched by PostgreSQL itself, whereas my scripting language (PHP) simply fetches data and serves it without altering time-based data.

When the user wants to modify her/his own timezone, I return the timezone list by using a query like this:

SELECT tz.name AS measure, tz.utc_offset AS utc_offset, tz.is_dst AS is_dst FROM pg_timezone_names() tz;

Users will be able to choose their timezone by specifying the extended timezone name tz.name. I'm not using nor allowing any timezone abbreviation in any way.

According to the official docucmentation I can change the timezone abbrevs, but I'm not finding any piece of information about the Olson DB's version used by Postgres. I really would like to have control on the Olson DB, so:

  1. Where can I find any information about the timezone's DB version used?
  2. Is it possible updating the timezone's DB by replacing the newest official IANA version? Consider a legacy system with Postgres 8.4 and no chance of updating it.

Thanks so much guys

Evan Carroll
65.7k50 gold badges259 silver badges510 bronze badges
asked Jan 22, 2017 at 13:54
2
  • AFAIK, timezones and how they work is managed by PostgreSQL itself. We, users, aren't supposed to modify the system tables "by hand". My guess (based on the existence of folders timezone and timezonesets within the PostgreSQL folder) is that some part of this information [specially regarding DST rules] is so sophisticated it cannot be handled by just a list on a table. Commented Jan 22, 2017 at 18:12
  • What version of the database are you using? Commented Jan 22, 2017 at 19:31

1 Answer 1

3

Currently (Jan 23, 2017)

You can see the change long for the tz database upstream here

  1. Where can I find any information about the timezone's DB version used?

check out the README in src/timezone/README which says "the code in this directory is currently synced with tzcode release 2016j."

  1. Is it possible updating the timezone's DB by replacing the newest official IANA version? Consider a legacy system with Postgres 8.4 and no chance of updating it.

It's already the latest version, but I imagine if it ever falls behind patches would be accepted. You can find the instructions to create the patch in the README file above.

answered Jan 22, 2017 at 19:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.