如何选择模式以在PostgreSQL中创建表格
问题描述:
我创建了WSI模式,并试图在该查询下创建一个表格,我不断收到下面的错误。我试图将搜索路径设置为新模式,但我仍然遇到同样的错误。如何选择模式以在PostgreSQL中创建表格
ERROR: no schema has been selected to create in
SQL state: 3F000
我尝试和输出功能如下所示
答
我怀疑这是造成问题的大写的模式名称。
test=# set search_path to WSI;
SET
test=# show search_path;
search_path
-------------
wsi
(1 row)
test=# create table myt (id integer);
ERROR: no schema has been selected to create in
LINE 1: create table myt (id integer);
^
test=# set search_path to "WSI";
SET
test=# show search_path;
search_path
-------------
"WSI"
(1 row)
test=# create table myt (id integer);
CREATE TABLE
+0
感谢您的帮助! – Kaylee
请您复制/粘贴SQL脚本和整个输出为文本而不是图像。 –
对不起,没有意识到我的截图没有显示脚本。 create table wsi.032616to032617_new(column1 varchar,userid varchar,cnt int); – Kaylee