Обсуждение: [GENERAL] tzdata version

Поиск
Список
Период
Сортировка

[GENERAL] tzdata version

От
Jerome Wagner
Дата:
Hello,

As i understand it, the tzdata on which the timezone information is based is updated regularly (semi-manually) in https://github.com/postgres/postgres/tree/master/src/timezone

Am i correct in stating that there is currently no way to update the tzdata database except by recompiling postgres after a new version of the tz database has been adapted for postgres ?

Is there a way to introspect the current version of the tzdata release (2014j, 2016h, 2017b, ..) that is embedded in a pre-compiled postgres (at runtime or in another way) ?

Thanks
Jérôme

Re: [GENERAL] tzdata version

От
Tom Lane
Дата:
Jerome Wagner <jerome.wagner@laposte.net> writes:
> As i understand it, the tzdata on which the timezone information is based
> is updated regularly (semi-manually) in https://github.com/
> postgres/postgres/tree/master/src/timezone

> Am i correct in stating that there is currently no way to update the tzdata
> database except by recompiling postgres after a new version of the tz
> database has been adapted for postgres ?

It's in the standard tzdata format, so if you have a copy of zic laying
about, you could download a new tzdata file set and run zic to install
the new files into the PG installation tree.  There's no need to recompile
Postgres per se.

However, if this seems like a problem to you and you are on a platform
whose vendor updates tzdata reliably, you should consider building PG
with --with-system-tzdata so that it will rely on the vendor copy.
We've always seen distributing a copy of tzdata as being mainly a
service to people stuck on platforms where that doesn't happen.

> Is there a way to introspect the current version of the tzdata release
> (2014j, 2016h, 2017b, ..) that is embedded in a pre-compiled postgres (at
> runtime or in another way) ?

I don't know of any version labeling in the tzdata files themselves
(not that I've looked very hard for one).  If you know your PG minor
release you could look into our release notes to see what tzdata
release it shipped with.

            regards, tom lane


Re: [GENERAL] tzdata version

От
Jerome Wagner
Дата:
Thank you for your answer.

When compiled with "--with-system-tzdata", does postgres need a restart after the system is updated with the new tzdata ?

  regards, jérôme wagner

On Fri, Jul 28, 2017 at 4:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jerome Wagner <jerome.wagner@laposte.net> writes:
> As i understand it, the tzdata on which the timezone information is based
> is updated regularly (semi-manually) in https://github.com/
> postgres/postgres/tree/master/src/timezone

> Am i correct in stating that there is currently no way to update the tzdata
> database except by recompiling postgres after a new version of the tz
> database has been adapted for postgres ?

It's in the standard tzdata format, so if you have a copy of zic laying
about, you could download a new tzdata file set and run zic to install
the new files into the PG installation tree.  There's no need to recompile
Postgres per se.

However, if this seems like a problem to you and you are on a platform
whose vendor updates tzdata reliably, you should consider building PG
with --with-system-tzdata so that it will rely on the vendor copy.
We've always seen distributing a copy of tzdata as being mainly a
service to people stuck on platforms where that doesn't happen.

> Is there a way to introspect the current version of the tzdata release
> (2014j, 2016h, 2017b, ..) that is embedded in a pre-compiled postgres (at
> runtime or in another way) ?

I don't know of any version labeling in the tzdata files themselves
(not that I've looked very hard for one).  If you know your PG minor
release you could look into our release notes to see what tzdata
release it shipped with.

                        regards, tom lane

Re: [GENERAL] tzdata version

От
Tom Lane
Дата:
Jerome Wagner <jerome.wagner@laposte.net> writes:
> When compiled with "--with-system-tzdata", does postgres need a restart
> after the system is updated with the new tzdata ?

No, but existing sessions will carry on with whatever data they've read
from the tzdata files; we don't have a provision to reload a timezone
definition once read by a given process.

Whether you use --with-system-tzdata doesn't matter; the same would apply
if you were updating a Postgres-private copy of the tzdata files.

            regards, tom lane