这是我的代码:
SET SEARCH_PATH TO work
/* Task 1 */
INSERT INTO Category (CategoryID, Name, CategoryType)
VALUES(1,'English','fiction');
这是错误:
ERROR: syntax error at or near "INSERT"
LINE 4: INSERT INTO Category (CategoryID,Name,CategoryType)
^
********** Error **********
ERROR: syntax error at or near "INSERT"
SQL state: 42601
Character: 45
答案 0 :(得分:2)
在SET语句的末尾需要一个分号:
SET SEARCH_PATH TO work;
答案 1 :(得分:1)
尝试插入符合模式的插件:
INSERT INTO work.Category (CategoryID, Name, CategoryType)
VALUES(1,'English','fiction');
或者
SET SEARCH_PATH TO work;
/* Task 1 */
INSERT INTO Category (CategoryID, Name, CategoryType)
VALUES(1,'English','fiction');
要么修复错误。