每当我输入heroku pg:push来获取heroku上的本地数据库。我得到了权限被拒绝的错误。知道如何解决它。
$ heroku pg:push mexico2019 HEROKU_POSTGRESQL_COBALT_URL --app mexican
错误:
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: permission denied for relation actions
pg_dump: The command was: LOCK TABLE public.actions IN ACCESS SHARE MODE
pg_dump: *** aborted because of error
pg_restore: [archiver] input file is too short (read 0, expected 5)
的database.yml
development:
adapter: postgresql
encoding: unicode
host: localhost
username: ram
password: (password)
database: mexico2019
timeout: 5000
production:
adapter: postgresql
encoding: unicode
host: localhost
username: postgres
password: (password)
database: meximexi_pro
pool: 5
timeout: 5000
List of relations
Schema | Name | Type | Owner
--------+------------------------------+----------+-------
public | actions | table | ram
public | actions_id_seq | sequence | ram
public | admins | table | ram
我试过
$ sudo su postgres
postgres=# GRANT ALL PRIVILEGES ON DATABASE mexico2019 TO ram;
GRANT
我刚注意到当我输入错误密码时,它说'psql:FATAL:密码验证失败,用户“alain”',不应该说用户ram?