PGError: ERROR: permission denied for relation (when using Heroku)

后端 未结 6 797
悲哀的现实
悲哀的现实 2020-12-13 03:22

I\'ve recently gone through the database migration process as outlined here:

https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres<

6条回答
  •  生来不讨喜
    2020-12-13 04:07

    UPDATE: Ashton's answer nails it in this situation, which is very Heroku specific. If you found this from a search for PostgreSQL error messages or problems but are not using Heroku, please look for other questions more likely to apply to your situation.


    At a guess, the PostgreSQL user ID you're connecting with is not the owner of your tables, and you haven't issued any explicit GRANT statements to give it access to them. Without seeing exactly what you ran when you migrated it's hard to say more - and Heroku hides many of the internals anyway.

    Let's work out what the current situation is. Try connecting with psql and running:

    \dp the_problem_table
    

    and show the permisions reported. Also show the result of:

    SHOW current_user;
    

    run from psql and when run as an SQL query from inside your application.

    Edit your question to add that information and the full, exact text of the error message you get.

提交回复
热议问题