Skip to content

Commit 02720f8

Browse files
authored
Merge pull request #10395 from sapcc/postgres-fix-collation-upgrades
postgresql-ng: fix collation refresh for DBs
2 parents 68f56ea + 8f1b2a1 commit 02720f8

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

common/postgresql-ng/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ description: Chart for PostgreSQL
4747
#
4848
# 2.2.0
4949
# - Removed support for PostgreSQL 15, because Alpine 3.23 does not carry packages for it anymore.
50-
version: 2.2.1 # this version number is SemVer as it gets used to auto bump
50+
version: 2.2.2 # this version number is SemVer as it gets used to auto bump

common/postgresql-ng/docker/entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ if [[ $updated_db == true ]]; then
218218
fi
219219

220220
PGDATABASE='postgres' process_sql -c "ALTER DATABASE \"template1\" REFRESH COLLATION VERSION"
221-
PGDATABASE="$DB" process_sql -c "ALTER DATABASE \"$DB\" REFRESH COLLATION VERSION"
221+
for DB in $DATABASES; do
222+
PGDATABASE="$DB" process_sql -c "ALTER DATABASE \"$DB\" REFRESH COLLATION VERSION"
223+
done
222224
fi
223225

224226
# maintain password of superuser account "postgres" (this is required because this password is different on each run)
@@ -231,9 +233,8 @@ if [[ -f /sql-on-startup.d/phase1-system.sql ]]; then
231233
echo "Processing /sql-on-startup.d/phase1-system.sql..."
232234
PGDATABASE='postgres' process_sql -f <(substituteSqlEnvs /sql-on-startup.d/phase1-system.sql)
233235
fi
234-
for FILE in /sql-on-startup.d/phase2-*.sql; do
235-
DB="$(basename "$FILE" | sed 's/^phase2-\(.*\)\.sql$/\1/')"
236-
PGDATABASE="$DB" process_sql -f "$FILE"
236+
for DB in $DATABASES; do
237+
PGDATABASE="$DB" process_sql -f "/sql-on-startup.d/phase2-$DB.sql"
237238
done
238239

239240
# stop and exec later to properly attach to forward signals and stdout/stderr properly

common/postgresql-ng/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ spec:
7575
image: "{{ include "preferredRegistry" . }}/postgres-ng:{{ .Values.imageTag }}"
7676
imagePullPolicy: "IfNotPresent"
7777
env:
78+
- name: DATABASES
79+
value: {{ .Values.databases | join " " | quote }}
7880
- name: DEBUG
7981
value: {{ .Values.debug | quote }}
8082
- name: PERSISTENCE_ENABLED

0 commit comments

Comments
 (0)