PostgreSQL 16 images based on EL10 have an incorrect POSTGRESQL_PREV_VERSION set

Open Beginner friendly
#661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, dockerfile, postgresql
Domain
databases, devops

Research direction

Start with 16/Dockerfile.c10s at lines 13-14 and inspect how POSTGRESQL_PREV_VERSION is set for the CentOS Stream 10 image. Reproduce the upgrade with the provided Podman commands and verify the postgresql-upgrade package's PostgreSQL 13 binaries. Done means the default upgrade succeeds without explicitly setting POSTGRESQL_PREV_VERSION, while the CentOS Stream 9 behavior remains correctly documented.

Written by the indexing model from the issue text.

Description

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:

https://github.com/sclorg/postgresql-container/blob/f1c89bca212c6a829ab74fdfdeec264f0d08a992/16/Dockerfile.c10s#L13-L14

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 https://github.com/theforeman/foremanctl/pull/577#issuecomment-4832709364

% 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
Dominant language
PLpgSQL
Stars
178
Forks
220
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sclorg/postgresql-container

All issues in sclorg/postgresql-container

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.