fix replication user creation
This commit is contained in:
parent
6648ab0f79
commit
53f14c6fed
1 changed files with 4 additions and 6 deletions
10
flake.nix
10
flake.nix
|
@ -591,14 +591,12 @@
|
||||||
if $PSQL --command "SELECT 1 FROM pg_roles WHERE rolname='${cfg.replication.username}';" | grep -q 1
|
if $PSQL --command "SELECT 1 FROM pg_roles WHERE rolname='${cfg.replication.username}';" | grep -q 1
|
||||||
then
|
then
|
||||||
echo "alter replication user ${cfg.replication.username}"
|
echo "alter replication user ${cfg.replication.username}"
|
||||||
$PSQL \
|
echo "ALTER ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';" | $PSQL \
|
||||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)" \
|
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)"
|
||||||
--command "ALTER ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';"
|
|
||||||
else
|
else
|
||||||
echo "create replication user ${cfg.replication.username}"
|
echo "create replication user ${cfg.replication.username}"
|
||||||
$PSQL \
|
echo "CREATE ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';" | $PSQL \
|
||||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)" \
|
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)"
|
||||||
--command "CREATE ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';"
|
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
else "";
|
else "";
|
||||||
|
|
Loading…
Reference in a new issue