Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

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

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

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

Now I'm seeing a number of errors in the logs like this:

PGError: ERROR: permission denied for relation

Any ideas on what I should do to fix it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem but the root cause was that my app was pointing to the old dev database which had exceeded it's limit of 10,000 rows.

Although I created a new Basic db and backed everything up, the app was still pointing the old dev DB.

heroku pg:info

Check to see the rows: 10300/10000 (then you have a problem)

You will need to

1) Create new DB with more rows (Basic or the "Production" ones -> Heroku seems to be forcing an upgrade to make more money errrrrr)

2) backup the old DB using pgbackups: heroku pg:backups:capture SMALL_DB_NAME

3) restore the backup to the new DB: heroku pg:backups:restore BACKUP_ID BIG_DB_NAME (see links below for more details)

4) PROMOTE the new DB to the primary for the app: heroku pg:promote BIG_DB_NAME

can always utilize:

heroku maintenance:on (to disable the app while updating)


heroku maintenance:off


heroku pg:info (to check the status)

If this is the problem you may want to check out: https://devcenter.heroku.com/articles/heroku-postgres-starter-tier https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

62 comments

56.7k users

...