example:
t=# create database z;
CREATE DATABASE
t=# alter database z set timezone to 'UTC+2';
ALTER DATABASE
t=# select now();
now
------------------------------
2018-01-17 08:41:10.12834+00
(1 row)
t=# \c z
You are now connected to database "z" as user "postgres".
z=# select now();
now
-------------------------------
2018-01-17 06:41:15.588483-02
(1 row)
as you can see after connecting to database z
client "default" TimeZone
changed. But you should not think, that dates changed in the database - no. all timezone aware timestamps are kept in UTC.
For timestamp with time zone, the internally stored value is always in
UTC
Now back to your question. Indeed:
z-# \! pg_dump -d z | grep "TimeZone"
if you backup database z, no its settings exported. So you need to use pg_dumpall
:
z-# \! pg_dumpall | grep "TimeZone"
ALTER DATABASE z SET "TimeZone" TO 'UTC+2';