Skip to content

Commit

Permalink
Merge pull request #212 from patrickhallen/master
Browse files Browse the repository at this point in the history
Fix recognition of errors for dbrestore with postgresql
  • Loading branch information
ZuluPro committed Nov 17, 2016
2 parents cb79426 + ef7aaca commit fd89093
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbbackup/db/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def _restore_dump(self, dump):
if self.settings.get('USER'):
cmd += ' --user={}'.format(self.settings['USER'])
cmd += ' --no-password'
# without this, psql terminates with an exit value of 0 regardless of errors
cmd += ' --set ON_ERROR_STOP=on'
if self.single_transaction:
cmd += ' --single-transaction'
cmd = '{} {} {}'.format(self.restore_prefix, cmd, self.restore_suffix)
Expand Down

0 comments on commit fd89093

Please sign in to comment.