Skip to content

dbrestore fails on PostgreSQL when the db user hasn't superuser permissions #213

@patrickhallen

Description

@patrickhallen

Hi,
on my system (Debian Jessie, Postgre 9.4, Django 1.10, Python 3.4) dbrestore fails withERROR: must be owner of extension plpgsql. This is after applying the changes in #212 to get an error message at all.

There are two obvious ways to fix this, both of which I don't particular like. One can either give the Django db user superuser permission or one can run the dbrestore command as the postgres superuser. To run dbrestore as the postgres user I have to give this user the permission to execute manage.py. Both of these options reduce the isolation between the user under which the Django application runs and the postgres user.

Another possible fix could be related to #190. The usage of the pg_restore command instead of pgsql gives a more fine-grained control over what to restore so one could limit the restore to the parts where the Django db user has the appropriate permissions for.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions