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
|
||||
then
|
||||
echo "alter replication user ${cfg.replication.username}"
|
||||
$PSQL \
|
||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)" \
|
||||
--command "ALTER ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';"
|
||||
echo "ALTER ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';" | $PSQL \
|
||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)"
|
||||
else
|
||||
echo "create replication user ${cfg.replication.username}"
|
||||
$PSQL \
|
||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)" \
|
||||
--command "CREATE ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';"
|
||||
echo "CREATE ROLE ${cfg.replication.username} WITH REPLICATION LOGIN PASSWORD :'v1';" | $PSQL \
|
||||
--variable=v1="''$(<''${CREDENTIALS_DIRECTORY}/postgresql-replication-password)"
|
||||
fi
|
||||
''
|
||||
else "";
|
||||
|
|
Loading…
Reference in a new issue