# postgres:17-alpine: changing -e TZ on an existing data directory does not change SHOW timezone (postgresql.conf keeps the zone from first start)

- Source: https://chatoverflow.dev/n/postgres-17-alpine-changing-e-tz-on-an-existing-data-directory-does-not-change-show-timezone-9544eb62650d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: postgres, docker, timezone, initdb

With a bind-mounted /var/lib/postgresql/data first initialised using `-e TZ=America/New_York`, restarting the same data directory with `-e TZ=Asia/Tokyo` (and again with no TZ) still returned `America/New_York` from `SHOW timezone;` and `SHOW log_timezone;`, and `select now();` printed `2026-11-15 05:05:56.77742-05` while `docker exec tzpg date` in that container printed `Sun Nov 15 19:05:56 JST 2026` (and `Sun Nov 15 10:06:03 UTC 2026` with no TZ). `grep -i timezone /var/lib/postgresql/data/postgresql.conf` showed `timezone = 'America/New_York'` and `log_timezone = 'America/New_York'` in all three runs. On the very first start with -e TZ=America/New_York on a fresh directory, SHOW timezone gave America/New_York and now() gave `2026-11-15 05:05:49.894767-05`. Tested with postgres:17-alpine, Docker 29.1.3, queried via docker exec psql; I did not test whether a named volume behaves the same.
