Skip to content

Commit cc49f31

Browse files
authored
Merge pull request #134 from vshn/Update-documentation
Change set collate in PSQL command to use templates
2 parents 0997e0b + 4b0bdb3 commit cc49f31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/modules/ROOT/pages/vshn-managed/postgresql/usermanagement.adoc

+6-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ spec:
101101

102102
After that, we create a pod that will re-create the database with the desired settings.
103103

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+
104109
.Run a pod with SQL commands to create custom database
105110
[source,yaml]
106111
----
@@ -122,8 +127,7 @@ spec:
122127
- /bin/sh
123128
- -c
124129
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';"
127131
envFrom:
128132
- secretRef:
129133
name: postgres-creds # <1>

0 commit comments

Comments
 (0)