Skip to content

Commit

Permalink
fix: allow backup verification and restore to work with patroni
Browse files Browse the repository at this point in the history
  • Loading branch information
thegentlemanphysicist committed Apr 5, 2024
1 parent b18c486 commit 0db3b46
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/backup.postgres.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ function onRestoreDatabase(){
echo
fi

# Drop Patroni-specific schemas
if (( ${_rtnCd} == 0 )); then
psql -h "${_hostname}" ${_portArg} -a -d ${_database} <<EOF
DROP SCHEMA IF EXISTS metric_helpers CASCADE;
DROP SCHEMA IF EXISTS user_management CASCADE;
EOF

_rtnCd=${?}
echo
fi

# Grant User Access
if (( ${_rtnCd} == 0 )); then
psql -h "${_hostname}" ${_portArg} -ac "GRANT ALL ON DATABASE \"${_database}\" TO \"${_username}\";"
Expand Down

0 comments on commit 0db3b46

Please sign in to comment.