Environment
- Databasement: 1.7.3
- PostgreSQL
- Dump format: Plain
- Backup ownership information: Disabled
- Backup privilege information: Disabled
Steps to reproduce
- Configure a PostgreSQL database server in Databasement using a non-owner role,
databasement.
- Grant the documented database, schema, table, and default privileges.
- Use a source database whose tables and
public schema are owned by another role, such as admin.
- Create a backup using plain dump format.
- Modify data in the source database.
- Restore the snapshot back into the same database with database recreation disabled.
- Check the restore task status and the restored data.
Expected behavior
The restore should fail when PostgreSQL rejects cleanup or restore statements. The task should report failure and propagate the psql exit status.
Actual behavior
Databasement reports the restore as completed, although the SQL restore contains errors and the original data remains unchanged. psql continues after the errors and the restore is treated as successful.
Example output:
ERROR: must be owner of table restore_probe
ERROR: must be owner of schema public
ERROR: relation "restore_probe" already exists
ERROR: duplicate key value violates unique constraint "restore_probe_pkey"
Additional context
A restore into an empty, pre-created database succeeds. The failure occurs when restoring in place because GRANT ALL PRIVILEGES does not grant ownership of existing tables or schemas.
The plain SQL restore should invoke psql with error stopping enabled, for example:
psql -v ON_ERROR_STOP=1 ...
The restore task should then propagate the non-zero exit status and report the operation as failed.
Environment
Steps to reproduce
databasement.publicschema are owned by another role, such asadmin.Expected behavior
The restore should fail when PostgreSQL rejects cleanup or restore statements. The task should report failure and propagate the
psqlexit status.Actual behavior
Databasement reports the restore as completed, although the SQL restore contains errors and the original data remains unchanged.
psqlcontinues after the errors and the restore is treated as successful.Example output:
Additional context
A restore into an empty, pre-created database succeeds. The failure occurs when restoring in place because GRANT ALL PRIVILEGES does not grant ownership of existing tables or schemas.
The plain SQL restore should invoke psql with error stopping enabled, for example:
psql -v ON_ERROR_STOP=1 ...
The restore task should then propagate the non-zero exit status and report the operation as failed.