log_timezone
log_timezone
is a configuration parameter determining the time zone used for timestamps written in the PostgreSQL log.
log_timezone
was added in PostgreSQL 8.3.
Usage
The time zone is displayed in the server log as the corresponding time zone abbreviation, e.g. for Europe/Berlin
, CEST
will be displayed. See pg_timezone_names
for the list of time zone to abbreviation mappings. However it is not possible to specifiy the time zone abbreviation directly.
Default value
The default value for log_timezone
is: GMT
.
Note that the value for log_timezone
is explicitly set to reflect the local server timezone in the postgresql.conf
file generated by initdb
.
Change history
- PostgreSQL 8.3
- added (commit bdd6b622)
Examples
log_timezone
is usually set by initdb
to the server time zone:
$ initdb -D /var/lib/pgsql/data ... selecting default time zone ... Europe/Berlin ... $ grep log_timezone /var/lib/pgsql/data/postgresql.conf log_timezone = 'Europe/Berlin'
Sample log output with log_timezone
set to Europe/Berlin
:
[2022-08-15 03:05:32 CEST] psql postgres postgres LOG: 00000: statement: SELECT 1;
It is not possible to specify a time zone abbreviation for log_timezone
:
postgres=# ALTER SYSTEM SET log_timezone = 'CEST'; ERROR: invalid value for parameter "log_timezone": "CEST"
References
- PostgreSQL documentation: log_timezone