Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

PostgreSQL does not know the time zone name Europe/Kyiv

ErrorERROR: invalid value for parameter "TimeZone": "Europe/Kyiv"

Short answer

The name Europe/Kyiv exists only in IANA time zone data from release 2022b onward. A PostgreSQL server, or a Docker image, built with older data does not list it. Check pg_timezone_names; then update the server's time zone data by upgrading the image or package, or send the older name Europe/Kiev.

  • Applies to PostgreSQL 15, PostgreSQL 16, PostgreSQL 17, Docker Engine 27
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the server which spelling it knows. If the first query returns no row, the server's time zone data is older than the name.

    psql -c "SELECT name FROM pg_timezone_names WHERE name IN ('Europe/Kyiv','Europe/Kiev');"
  2. 2Match what you see, then jump to its fix

    1. 1Europe/Kiev is listed and Europe/Kyiv is notThe server's time zone data is older than release 2022bFix
    2. 2The server is fine for psql, but an app, driver or PGTZ sends Europe/Kyiv on connectA client sends a name the server does not haveFix
    3. 3The error appears for one database or role only, or after a config file editA configuration file sets the zone before the data is availableFix

What does the error look like?

  • ERROR: invalid value for parameter "TimeZone": "Europe/Kyiv"
  • FATAL: invalid value for parameter "TimeZone": "Europe/Kyiv"

Cause 1 of 3

The server's time zone data is older than release 2022b

1Check

IANA renamed Europe/Kiev to Europe/Kyiv in the 2022b release (10 August 2022). PostgreSQL recognizes only the names in its own time zone files, so a server built before that does not know the new name.

psql -c "SHOW server_version;"
psql -c "SELECT count(*) FROM pg_timezone_names WHERE name = 'Europe/Kyiv';"

2Fix

Move to a newer PostgreSQL minor release or image, so the data files are newer. In Docker, pull the current tag and recreate the container; keep the data volume.

docker pull postgres:17
docker compose up -d --force-recreate db

3Verify

The same query returns one row, and the session accepts the name.

psql -c "SET TIME ZONE 'Europe/Kyiv'; SHOW TimeZone;"

Confirmed by data.iana.org

Did this fix it?

Cause 2 of 3

A client sends a name the server does not have

1Check

Clients such as libpq read the PGTZ variable and send it to the server on connect. A client that sends the new name to an older server hits the same error.

echo "$PGTZ"
psql -c "SHOW TimeZone;"

2Fix

Set the zone to a name that the server lists, until the server is updated.

# only if pg_timezone_names lists Europe/Kiev
export PGTZ=Europe/Kiev
# or per session
# SET TIME ZONE 'Europe/Kiev';

3Verify

Reconnect and print the setting.

psql -c "SHOW TimeZone;"

Confirmed by postgresql.org

Did this fix it?

Cause 3 of 3

A configuration file sets the zone before the data is available

1Check

TimeZone can be set in postgresql.conf and in role or database settings. A stored name the server does not recognize gives the same error.

psql -c "SELECT setconfig FROM pg_db_role_setting;"
grep -n "timezone" /var/lib/postgresql/data/postgresql.conf

2Fix

Use a name from pg_timezone_names in each place until the server data is updated.

ALTER DATABASE app SET timezone TO 'Europe/Kiev';

3Verify

Reconnect to that database and show the setting.

SHOW TimeZone;

Confirmed by postgresql.org

Did this fix it?

How do I stop it coming back?

  • Take PostgreSQL minor updates when they ship; time zone files come with them.
  • Do not pin a Docker image by an old digest for years.
  • Test any new zone name against pg_timezone_names before adding it to a config file.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.