You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/post-upgrade.sh
+50-2Lines changed: 50 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -113,11 +113,59 @@ function migrateConstraintsOnPartitionedTables() {
113
113
# set config key so migration is only done once
114
114
doguctl config migrated_database_constraints true
115
115
}
116
-
migrateConstraintsOnPartitionedTables
116
+
117
+
# see https://www.postgresql.org/docs/14/release-14-12.html#:~:text=Restrict%20visibility%20of,WITH%20ALLOW_CONNECTIONS%20false%3B for more information
118
+
functionrestrictStatVisibility() {
119
+
if [ !-f /usr/share/postgresql/fix-CVE-2024-4317.sql ];then
120
+
return 0
121
+
fi
122
+
123
+
while! pg_isready >/dev/null;do
124
+
# Postgres is not ready yet to accept connections
125
+
sleep 0.1
126
+
done
127
+
# temporarily accept connections on template0
128
+
psql -U postgres -c "ALTER DATABASE template0 WITH ALLOW_CONNECTIONS true;"
129
+
130
+
# get all tables
131
+
psql -U postgres -c "SELECT d.datname as \"Name\" FROM pg_catalog.pg_database d;" -X > databases
132
+
# there are four lines of sql result information (two at the start, two at the end)
0 commit comments