我刚刚将 RDS 实例启动到 Postgresql 数据库。数据库已成功创建,我能够连接。问题是当我运行此代码时:
CREATE SCHEMA hollywood;
CREATE TABLE films (title text, release date, awards text[]);
SELECT * FROM hollywood.films;
Run Code Online (Sandbox Code Playgroud)
这是我得到的输出:
Schema hollywood created
Table films created
An error occurred when executing the SQL command:
SELECT * FROM hollywood.films
ERROR: relation "hollywood.films" does not exist
Run Code Online (Sandbox Code Playgroud)
我在这里缺少什么?我在架构名称周围添加了双引号,但无济于事。我因此为用户打开了权限,但无济于事(不好,我知道)
grant all privileges on all tables in schema hollywood to bi;
Run Code Online (Sandbox Code Playgroud)
我这样在我的选择语句之前添加了搜索路径:
SET search_path TO hollywood; select....
Run Code Online (Sandbox Code Playgroud)
没变。