值得注意的信息
- 我在 Windows 7 64 位上使用Postgresql 9.2 。它是使用Postgresql 网站提供的安装程序安装的
- 我以 postgres 身份登录到postgres数据库
- 我在postgres用户下创建BryceTest Schema
- 我配置
search_path
为显示"brycetest, public"
由 pgAdmin-III 提供的查询生成器生成的此 SQL 按预期工作
SELECT "DummyDataMasterTable"."Dummy_PK",
"DummyDataMasterTable"."DummyName"
FROM "BryceTest"."DummyDataMasterTable";
但这不是
SELECT DummyDataMasterTable.Dummy_PK,
DummyDataMasterTable.DummyName
FROM BryceTest.DummyDataMasterTable;
-------------------------------------------
ERROR: relation "dummydatamastertable" does not exist
LINE 4: FROM DummyDataMasterTable;
^
********** Error **********
ERROR: relation "dummydatamastertable" does not exist
SQL state: 42P01
Character: 101
FROM BryceTest.DummyDataMasterTable;
也没有
SELECT
Dummy_PK,
DummyName
FROM DummyDataMasterTable;
-------------------------------
ERROR: relation "dummydatamastertable" does not exist
LINE 4: FROM DummyDataMasterTable; ^
********** Error **********
ERROR: relation "dummydatamastertable" does not exist
SQL state: 42P01
Character: 59
我会认为,通过配置我的模式search_path
以首先查看我新创建的模式,它不需要完全限定schemaName.tableName