Ad Widget

Collapse

Postgres Upgrade from 14 to 17 Results in PostgreSQL server is not available

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • techmattr
    Member
    • Sep 2022
    • 39

    #1

    Postgres Upgrade from 14 to 17 Results in PostgreSQL server is not available

    I'm trying to upgrade my Zabbix 7.2 Docker instance to Zabbix 7.4....
    I need to upgrade my Postgres 14 to 17 first.
    I brought down my environment, and left just the postgres container running.
    dumped the db:
    docker exec -t postgres-server pg_dumpall -c -U zabbix > dump_$(date +%d-%m-%Y_%H_%M_%S).sql
    Brought down the container
    Updated the compose with postgres:17-alpine
    Deleted the postgres data: zbx_env/var/lib/postgresql/data/*
    Started the postgres container
    Restored the DB
    docker exec -i postgres-server /bin/bash -c "PGPASSWORD=zabbix psql --username zabbix zabbix" < /docker/zabbix/dump_$(date +%d-%m-%Y_%H_%M_%S).sql
    Updated the password (with the same password to convert from MD5 to SHA-256)
    docker exec -it postgres-server /bin/bash
    psql -U zabbix
    \password
    Started all containers

    The Zabbix container cannot connect to the database
    PostgreSQL server is not available...

    On the postgres server I'm getting the following error:
    Code:
    2025-10-20 09:32:50.261 EDT [192] ERROR:  column d.daticulocale does not exist at character 289
    2025-10-20 09:32:50.261 EDT [192] HINT:  Perhaps you meant to reference the column "d.datlocale".
    2025-10-20 09:32:50.261 EDT [192] STATEMENT:  SELECT
          d.datname as "Name",
          pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
          pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
          CASE d.datlocprovider WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS "Locale Provider",
          d.datcollate as "Collate",
          d.datctype as "Ctype",
          d.daticulocale as "ICU Locale",
          d.daticurules as "ICU Rules",
          pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
        FROM pg_catalog.pg_database d
        ORDER BY 1;


    I ran through these exact same steps in my test environment with no issues.
  • PSklyar
    Member
    • Sep 2025
    • 30

    #2
    Not sure but seams error you're encountering is due to a schema change between PostgreSQL 14 and 17.
    The column d.daticulocale was renamed to d.datlocale in newer PostgreSQL versions.
    This error is happening because Zabbix 7.2 is trying to query database information using the old column name.
    Maybe it might be a reason.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #3
      Use pg_dumpall from new version to dump data..

      Comment

      • techmattr
        Member
        • Sep 2022
        • 39

        #4
        Originally posted by cyber
        Use pg_dumpall from new version to dump data..
        And do what with it?

        Comment

        • techmattr
          Member
          • Sep 2022
          • 39

          #5
          Originally posted by PSklyar
          Not sure but seams error you're encountering is due to a schema change between PostgreSQL 14 and 17.
          The column d.daticulocale was renamed to d.datlocale in newer PostgreSQL versions.
          This error is happening because Zabbix 7.2 is trying to query database information using the old column name.
          Maybe it might be a reason.
          Possibly. I'm not a DBA so I'm not sure. I'm not sure why this would happen in one environment and not the other. They are clones of each other.

          Comment

          Working...