Skip to content

Commit

Permalink
Merge pull request #127 from thegentlemanphysicist/patroni-fix
Browse files Browse the repository at this point in the history
fix: allow backup verification and restore to work with patroni
  • Loading branch information
WadeBarnes authored Apr 5, 2024
2 parents b18c486 + 0db3b46 commit 8c1ea09
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 8c1ea09

Please sign in to comment.