Skip to content

Commit 4d10f1b

Browse files
DEV: run pg_createcluster for old postgres version during update
We copy default configs for the old PG version during the update. Upstream changes disabled main cluster creation for old PG versions if a newer one exists so the old configs are no longer generated. To work around this, we can invoke pg_createcluster. See https://salsa.debian.org/postgresql/postgresql-common/-/commit/d9139f7777a42a39b5b6fabbffc9f020fad4dce5
1 parent e42fa97 commit 4d10f1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

templates/postgres.template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ run:
116116
install -d -m 0755 -o postgres -g postgres /shared/postgres_data_new && sudo -u postgres /usr/lib/postgresql/15/bin/initdb -D /shared/postgres_data_new || exit 0
117117
apt-get update
118118
apt-get install -y postgresql-${PG_MAJOR_OLD} postgresql-${PG_MAJOR_OLD}-pgvector
119+
pg_createcluster -u postgres --no-status ${PG_MAJOR_OLD} main
119120
chown -R postgres:postgres /var/lib/postgresql/15
120121
/etc/init.d/postgresql stop
121122
rm -fr /shared/postgres_data/postmaster.pid

0 commit comments

Comments
 (0)