18

I'm running Postgres 9.4. Every time I change it it's returning to default GMT after I reboot,

> $ psql -c 'show timezone'   

TimeZone

>  US/Central

Is there a parameter option to be added in postgres.conf?

Vladislav Povorozniuc
  • 2,149
  • 25
  • 26
Jecki
  • 802
  • 3
  • 16
  • 32

1 Answers1

26

You can set timezone param into pgsql/data/postgresql.conf file:

timezone = 'US/Central'

and then restart postgresql sever.

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
  • 1
    i did that and after restart the same thing reset to GMT . – Jecki Sep 06 '15 at 11:53
  • 3
    Can you check permissions and owner for `postgresql.conf` file. Also make sure you edit right config file, run `sudo -u postgres /usr/local/pgsql/bin/psql` and enter `SHOW config_file;` – Valery Viktorovsky Sep 06 '15 at 12:08
  • 4
    Many third-party clients have own timezone session settings overlapping any Postgres server and\or session settings. E.g. if you're using 'IntelliJ IDEA' (or DataGrips), you should define timezone in 'Advanced' tab -> 'VM Options': -Duser.timezone=UTC+06:00 for example. – ARA1307 Jan 09 '18 at 18:48
  • Handy: [Where does PostgreSQL store configuration/conf files?](https://stackoverflow.com/questions/3602450/where-does-postgresql-store-configuration-conf-files) – Henry Woody Feb 13 '22 at 00:39