dokku / dokku-postgres

a postgres plugin for dokku
MIT License
491 stars 97 forks source link

Table ownership all changed to "postgres" after restoring from dump #296

Closed laukaichung closed 8 months ago

laukaichung commented 1 year ago

All of the tables in my database were owned by a non-postgres user. After doing dokku import <service> < backup/export, the tables are now owned by postgres. Is it possible to keep the original ownership when restoring from the backup?

Here's how I schedule the backup:

$ dokku postgres:backup-auth <service> <aws-access-key-id> <aws-secret-access-key> <aws-default-region> 

$ dokku postgres:backup-schedule <service> <schedule> <bucket-name>
josegonzalez commented 1 year ago

At the moment, this plugin only supports using the postgres user. If you can figure out how to set that up a restore to the "correct" user, then we'll do that.

Code for exports: https://github.com/dokku/dokku-postgres/blob/master/functions#L163 Code for imports: https://github.com/dokku/dokku-postgres/blob/master/functions#L177

josegonzalez commented 8 months ago

Going to close this. I think managing multiple users is a good goal for those looking to squeeze out performance on a server, but out of focus for this project for now. I'll 100% take a PR that implements the correct ownership on restored backups though.