| 1 | #!/bin/sh |
| 2 | # Runs once, when the primary starts on an empty volume. |
| 3 | echo "host replication replicator all scram-sha-256" >> "$PGDATA/pg_hba.conf" |
| 4 | psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" \ |
| 5 | -c "create role replicator with replication login password 'replicator'" \ |
| 6 | -c "select pg_create_physical_replication_slot('replica')" \ |
| 7 | -c "select pg_reload_conf()" |