PostgreSQL – What Does POSIX/Europe/Paris Stand For?

postgresqltimezone

If you execute something like the following query on Postgres:

SELECT * FROM pg_timezone_names() WHERE name LIKE '%Rome%';

you get back a bunch of "weird" timezones:

postgres=# SELECT * FROM pg_timezone_names() WHERE name LIKE '%Rome%';
       name        | abbrev | utc_offset | is_dst
-------------------+--------+------------+--------
 Europe/Rome       | CET    | 01:00:00   | f
 posix/Europe/Rome | CET    | 01:00:00   | f
(2 rows)

I'm wondering why posix/ exists, what they stand for (they are not IANA official timezones right?) and when they are used. They look like a blend of POSIX standard and Olson DB, but posix should have -1 as utc_offset, right? I'm considering using the pg_timezone_names() function for giving the users the chance of choosing their own timezone, but I can't understand the meaning of this specific type of timezone in Postgres.

Best Answer

Generally, you shouldn't be using the Posix/ or Etc/ timezones if they're on your system. This isn't a PostgreSQL thing, it's your distributions libc database (sometimes packaged as tzdata/zoneinfo) for the internal timezone functions. Most of that POSIX stuff is nasty and old. PostgreSQL has a document on it which mentions it.

I guess to answer the question specifically,

Two different versions are provided: - The "posix" version is based on the Coordinated Universal Time (UTC). - The "right" version is based on the International Atomic Time (TAI), and it includes the leap seconds.

There really is no reason that I know of not to use the IANA names.