我刚刚将一个RDS实例转换为Postgresql数据库。数据库已成功创建,我可以连接。问题是当我运行此代码时:
CREATE SCHEMA hollywood;
CREATE TABLE films (title text, release date, awards text[]);
SELECT * FROM hollywood.films;
这是我得到的输出:
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
我在这里缺少什么?我在模式名称周围添加了双引号,但无济于事。我这样打开了用户的权限,但无济于事(糟糕,我知道)
grant all privileges on all tables in schema hollywood to bi;
我在select语句之前添加了搜索路径:
SET search_path TO hollywood; select....
没有变化。
答案 0 :(得分:4)
尝试:
CREATE SCHEMA hollywood;
CREATE TABLE hollywood.films (title text, release date, awards text[]);
SELECT * FROM hollywood.films;
或
CREATE SCHEMA hollywood;
SET search_path TO hollywood;
CREATE TABLE films (title text, release date, awards text[]);
SELECT * FROM films;