fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

Preserve Ownership of database and tables #40

Closed juanger closed 8 years ago

juanger commented 9 years ago

This PR is just to start the discussion about this feature and should not be considered for merging.

In my use case, in a single project I have two databases and each one has to be accessed by different users, so I need a way to keep the original ownership of each database after restoring a snapshot.

In order to achieve this I create one new connection to each database and alter the owner of it and all of its objects with REASSIGN OWNED. It works for me currently but it has some bugs and has the postgres username hardcoded.

BUG: REASSIGN OWNED seems to change not only the objects in the current database, but all of the objects, including databases that are shared. This means that all the stellar master/slave databases will also change ownership. As long as the user that you specify in your connection url is a super user it is not a problem for this to work but it is far from desirable.

juanger commented 8 years ago

I'm closing this PR as there was no interest for almost 2 years and it will never be merged in the current state. Feel free to continue the discussion here.