Thread: BUG #12537: It is not possible to configure postgres to use same timezone of the server.

BUG #12537: It is not possible to configure postgres to use same timezone of the server.

From
eantonini@eidoscode.com
Date:
The following bug has been logged on the website:

Bug reference:      12537
Logged by:          Endrigo Antonini
Email address:      eantonini@eidoscode.com
PostgreSQL version: 9.3.5
Operating system:   CentOS 6.5
Description:

It is not possible to configure postgresql server to use the same timezone
of the server. It is necessary that the postgres use the same timezone as
the server.
Today, each time I change the timezone of the server, I have to change the
timezone the configuration file of the postgresql. It's necessary to be
possible to configure it to use servers timezone.
On Tue, Jan 13, 2015 at 08:48:30PM +0000, eantonini@eidoscode.com wrote:
> The following bug has been logged on the website:
>
> Bug reference:      12537
> Logged by:          Endrigo Antonini
> Email address:      eantonini@eidoscode.com
> PostgreSQL version: 9.3.5
> Operating system:   CentOS 6.5
> Description:
>
> It is not possible to configure postgresql server to use the same timezone
> of the server. It is necessary that the postgres use the same timezone as
> the server.
> Today, each time I change the timezone of the server, I have to change the
> timezone the configuration file of the postgresql. It's necessary to be
> possible to configure it to use servers timezone.

According to the docs, there is no way to have log_timezone default to
the OS timezone:

        Sets the time zone used for timestamps written in the server log.
        Unlike <xref linkend="guc-timezone">, this value is cluster-wide,
        so that all sessions will report timestamps consistently.
        The built-in default is <literal>GMT</>, but that is typically
        overridden in <filename>postgresql.conf</>; <application>initdb</>
        will install a setting there corresponding to its system environment.
        See <xref linkend="datatype-timezones"> for more information.
        This parameter can only be set in the <filename>postgresql.conf</>
        file or on the server command line.

I suppose you could modify the Postgres server start script to set
log_timezone based on some OS setting though.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +