File tree 1 file changed +6
-2
lines changed
docs/modules/ROOT/pages/vshn-managed/postgresql
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ spec:
101
101
102
102
After that, we create a pod that will re-create the database with the desired settings.
103
103
104
+ [WARNING]
105
+ ====
106
+ This will drop the database and recreate it. Make sure you have a backup of the data before running this pod.
107
+ ====
108
+
104
109
.Run a pod with SQL commands to create custom database
105
110
[source,yaml]
106
111
----
@@ -122,8 +127,7 @@ spec:
122
127
- /bin/sh
123
128
- -c
124
129
args:
125
- - PGPASSWORD=$POSTGRESQL_PASSWORD psql "sslmode=verify-ca sslrootcert=/etc/secret-volume/ca.crt host=$POSTGRESQL_HOST port=$POSTGRESQL_PORT dbname=$POSTGRESQL_DB" -U $POSTGRESQL_USER -c "drop database if exists $DBNAME with (force)"
126
- -c "create database $DBNAME LC_COLLATE='C' LC_CTYPE='C' ENCODING='UTF-8' TEMPLATE='template0'"
130
+ - PGPASSWORD=$POSTGRESQL_PASSWORD psql "sslmode=verify-ca sslrootcert=/etc/secret-volume/ca.crt host=$POSTGRESQL_HOST port=$POSTGRESQL_PORT dbname=template1" -U $POSTGRESQL_USER -c "drop database if exists $DBNAME with (force);" -c "create database $DBNAME LC_COLLATE='C' LC_CTYPE='C' ENCODING='UTF-8' TEMPLATE='template0';"
127
131
envFrom:
128
132
- secretRef:
129
133
name: postgres-creds # <1>
You can’t perform that action at this time.
0 commit comments