【发布时间】:2021-11-16 12:49:12
【问题描述】:
我正在尝试运行数据库迁移,但收到以下错误:
psycopg2.ProgrammingError: must be owner of table request_settings
这是来自我的 .env 文件:
...
DB_USER=idaproject
DB_NAME=wellton
DB_PASSWORD=password
DB_HOST=127.0.0.1
DB_PORT=5432
...
所以,我假设这个表应该在“wellton”数据库中。用户“idaproject”是“wellton”数据库的所有者,拥有数据库的所有特权和权限。 然后我尝试用
更改 request_settings 表的所有者ALTER TABLE request_settings OWNER TO idaproject;
但好像不存在
ERROR: relation "request_settings" does not exist
我错过了什么吗?
【问题讨论】:
-
大概您缺少架构。
-
我确实有一个“公共”架构
-
还有,该表是否在该架构中?
-
应该是的,但是你可以从日志中看到它“不存在”
-
如果你找错地方了,但没有找到,那就是你得到的。例如:
/* nothing on the serach path */ SET search_path = ''; SELECT * FROM atable;.
标签: django postgresql