Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package postgres-14-image for openSUSE:Factory checked in at 2025-06-11 16:22:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/postgres-14-image (Old) and /work/SRC/openSUSE:Factory/.postgres-14-image.new.19631 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "postgres-14-image" Wed Jun 11 16:22:06 2025 rev:42 rq:1284395 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/postgres-14-image/postgres-14-image.changes 2025-05-30 17:25:01.642517934 +0200 +++ /work/SRC/openSUSE:Factory/.postgres-14-image.new.19631/postgres-14-image.changes 2025-06-11 16:23:19.188445936 +0200 @@ -1,0 +2,5 @@ +Tue Jun 10 08:35:06 UTC 2025 - SUSE Update Bot <bci-inter...@suse.de> + +- update docker-entrypoint script in preparation of postgresql 18 upgrade + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ docker-entrypoint.sh ++++++ --- /var/tmp/diff_new_pack.m0YChB/_old 2025-06-11 16:23:19.852473646 +0200 +++ /var/tmp/diff_new_pack.m0YChB/_new 2025-06-11 16:23:19.856473813 +0200 @@ -154,6 +154,29 @@ EOWARN fi } +# similar to the above, but errors if there are any "old" databases detected (usually due to upgrades without pg_upgrade) +docker_error_old_databases() { + if [ -n "${OLD_DATABASES[0]:-}" ]; then + cat >&2 <<-EOE + Error: in 18+, these Docker images are configured to store database data in a + format which is compatible with "pg_ctlcluster" (specifically, using + major-version-specific directory names). This better reflects how + PostgreSQL itself works, and how upgrades are to be performed. + + See also https://github.com/docker-library/postgres/pull/1259 + + Counter to that, there appears to be PostgreSQL data in: + ${OLD_DATABASES[*]} + + This is usually the result of upgrading the Docker image without upgrading + the underlying database using "pg_upgrade" (which requires both versions). + + See https://github.com/docker-library/postgres/issues/37 for a (long) + discussion around this process, and suggestions for how to do so. + EOE + exit 1 + fi +} # usage: docker_process_init_files [file [file [...]]] # ie: docker_process_init_files /always-initdb.d/* @@ -230,9 +253,17 @@ declare -g DATABASE_ALREADY_EXISTS : "${DATABASE_ALREADY_EXISTS:=}" + declare -ag OLD_DATABASES=() # look specifically for PG_VERSION, as it is expected in the DB dir if [ -s "$PGDATA/PG_VERSION" ]; then DATABASE_ALREADY_EXISTS='true' + elif [ "$PGDATA" = "/var/lib/postgresql/$PG_MAJOR/docker" ]; then + # https://github.com/docker-library/postgres/pull/1259 + for d in /var/lib/postgresql /var/lib/postgresql/data /var/lib/postgresql/*/docker; do + if [ -s "$d/PG_VERSION" ]; then + OLD_DATABASES+=( "$d" ) + fi + done fi } @@ -319,6 +350,7 @@ # only run initialization on an empty data directory if [ -z "$DATABASE_ALREADY_EXISTS" ]; then docker_verify_minimum_env + docker_error_old_databases # check dir permissions to reduce likelihood of half-initialized database ls /docker-entrypoint-initdb.d/ > /dev/null