postgres不断给出“模式不存在”错误

aaa*_*210 7 sql postgresql

我设法在架构FOO中创建了一个表。

每当我尝试做任何事情(甚至是基本选择)时,我都会得到:

ERROR: schema "FOO" does not exist
SQL state: 3F000
Character: 15
Run Code Online (Sandbox Code Playgroud)

我正在与创建的同一编辑窗口中运行select(使用pgAdmin4)。我尝试创建视图调用FOO.Info时遇到相同的错误。但是,当我尝试在FOO中创建新表时,它就可以工作。

这是怎么回事?我使用相同的语法将select中的表引用为create。

# worked fine
CREATE TABLE "FOO"."Events"
(
...

# all these have the error
select * from "FOO"."Events";
select * from FOO.Events;
select * from Foo.Events;
Run Code Online (Sandbox Code Playgroud)
ERROR: schema "FOO" does not exist
SQL state: 3F000
Character: 15
Run Code Online (Sandbox Code Playgroud)

Vao*_*sun 5

我相信你创造了它

create schema FOO;
Run Code Online (Sandbox Code Playgroud)

创建模式“foo”,而不是“FOO”

然后你将它引用为

select * from "FOO".table_name
Run Code Online (Sandbox Code Playgroud)

所以没有找到