Default config template breaks PostgreSQL


Active Member
Jun 27, 2007
Version: 5.2-2

in /var/lib/pmg/templates/ there are two timezone related parameters (timezone and log_timezone) with the default value of 'localtime'. When running without modification the PostgreSQL service fails to start.

2019-05-14 20:21:08.941 GMT [745] LOG:  invalid value for parameter "log_timezone": "localtime"
2019-05-14 20:21:08.951 GMT [745] LOG:  invalid value for parameter "TimeZone": "localtime"
2019-05-14 20:21:08.951 GMT [745] FATAL:  configuration file "/etc/postgresql/9.6/main/postgresql.conf" contains errors

We have overridden this template file by copying it to /etc/pmg/templates and correcting the problematic lines. However I'm quite puzzled as to why there is no other chatter about this issue. What could be special about our system that makes this an issue while others run as-is?
hmm - works here in a pmg setup on top of Debian (also tested with the PMG installer)...

The template also does not contain any substitution based on the config (that is a leftover from previous versions).

Anyways your set timezone of GMT gave me the hint:
* your system seem not to have configured a local timezone (which is different from explicitly setting GMT as timezone)
* IOW '/etc/localtime' is not a symlink to a file in '/usr/share/zoneinfo'

run `dpkg-reconfigure tzdata` and select a timezone, then postgresql should start

Hope this helps!
Actually my system is properly configured for America/Chicago (/etc/timezone and /etc/localtime). Logging timestamps don't necessarily reflect system time zones.

The fact remains that /var/lib/pmg/templates/ contains config parameters that are not compatible with postgresql 9.6 and the current version of that file on my system was verified by reinstalling the "pmg-api" package. In my case, I can only fix this by overriding the template.

If you are saying that the "localtime" value in the template is not injected at package installation time, then how are other systems not breaking? That's what puzzles me the most.

I have worked around my problem with this, so I guess no more response is necessary.
hmm - I only managed to get those error messages when removing /etc/localtime
otherwise postgres 9.6 on stretch (pmg) happily starts with:
log_timezone = 'localtime'
timezone = 'localtime'

in postgresql.conf

ls -la /etc/localtime 
lrwxrwxrwx 1 root root 33 May 15 10:05 /etc/localtime -> /usr/share/zoneinfo/Europe/Vienna
is what is set on my system


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!