2

My ultimate goal is to minimize (or eliminate, if possible) the possibility that my database records are updated or deleted/destroyed in any way after being created.

One suggestion I received is to create a new PostgreSQL database user with restricted privileges (no updating, no destroying) and make that user the default for development.

In Nitrous.io/Heroku, how do I create a new PostgreSQL user, restrict user permissions/privileges and switch to that user for development and production?

If you know a better way to eliminate the possibility for record alteration, please let me know.

Thanks

brntsllvn
  • 931
  • 11
  • 18

1 Answers1

1

This isn't possible with Heroku Postgres, which I'm assuming you're using. Heroku Postgres provisions a single user account for you by default, and that's all you can use. It's up to your application logic to restrict writes / updates / deletes.

If you need this sort of behavior guaranteed, you might want to look at either self-hosting your Postgres database, or using something like Amazon RDS to host your DB as that allows you to create users in a more fine-grained way.

rdegges
  • 32,786
  • 20
  • 85
  • 109
  • 1
    Thank you for pointing out this limitation. Assuming I want to build out my application logic (versus seeking another hosting option) to limit the possibility of record updating/deleting, can you suggest how this might be accomplished or point me toward documentation that may push me in the right direction? Thanks. – brntsllvn Feb 07 '15 at 17:20
  • I wish I could! It looks like you're ruby-on-rails, but I'm more of a Python / Node / Go guy, don't have any ruby experience :( You might be best off asking that in a new question with the ruby tag. Sorry > – rdegges Feb 07 '15 at 21:26
  • 1
    Appreciate your help, nonetheless! – brntsllvn Feb 07 '15 at 22:27