Skip to content

Commit d990f8e

Browse files
committed
Ensure PG databases are ready for logical replication
1 parent e026e79 commit d990f8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

generators/resources/postgres.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ spec:
5151
bootstrap:
5252
initdb:
5353
database: {{ .Chart.Name }}
54+
# The following statements ensure that we can create a replication slot and subscription
55+
# on the database without involving the superuser. This is useful for logical replication
56+
# for eg. major version upgrades.
5457
postInitSQL:
58+
- ALTER ROLE "{{ .Chart.Name }}" WITH REPLICATION;
5559
- GRANT pg_create_subscription TO "{{ .Chart.Name }}";
5660
postgresql:
5761
parameters:

0 commit comments

Comments
 (0)