Skip to content

PostgreSQL 16 images based on EL10 have an incorrect POSTGRESQL_PREV_VERSION set #661

Description

@ekohl

Container platform

Podman/Docker

Version

quay.io/sclorg/postgresql-16-c10s and the equivalent RHEL image

OS version of the container image

CentOS Stream 10

Bugzilla, Jira

https://redhat.atlassian.net/browse/RHEL-191375

Description

The value for POSTGRESQL_PREV_VERSION in the CentOS Stream 10 container is set to 15, but the postgresql-upgrade package in CentOS Stream has the PostgreSQL 13 binaries. So this part is wrong:

ENV POSTGRESQL_VERSION=16 \
POSTGRESQL_PREV_VERSION=15 \

It should be noted that the CentOS Stream 9 version of postgresql-upgrade for PostgreSQL does contain version 15 binaries so the documentation may end up a bit more complicated.

Reproducer

DATADIR=$(mktemp -d)
chmod 777 $DATADIR 
podman run --rm -it -e POSTGRESQL_ADMIN_PASSWORD=hunter2 -v $DATADIR:/var/lib/pgsql/data:Z quay.io/sclorg/postgresql-13-c9s
podman run --rm -it -e POSTGRESQL_ADMIN_PASSWORD=hunter2 -e POSTGRESQL_UPGRADE=hardlink -v $DATADIR:/var/lib/pgsql/data:Z quay.io/sclorg/postgresql-16-c10s

This fails, but when I use e POSTGRESQL_PREV_VERSION=13 as well the it can upgrade.

Copy-pasted from theforeman/foremanctl#577 (comment)

% podman run --rm -ti quay.io/sclorg/postgresql-16-c10s bash
…
bash-5.2$ rpm -q postgresql-upgrade
postgresql-upgrade-16.13-2.el10.x86_64
bash-5.2$ rpm -qf /usr/lib64/pgsql/postgresql-13/bin/postgres
postgresql-upgrade-16.13-2.el10.x86_64
bash-5.2$ /usr/lib64/pgsql/postgresql-13/bin/postgres --version
postgres (PostgreSQL) 13.23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions