I keep getting the error “relation [TABLE] does not exist”

牧云@^-^@ 提交于 2019-12-17 07:53:47

问题


I have been trying to query two tables in my database. In the server explorer I can see both tables and even see the columns within them. We'll call them Schema.table1 and Schema.table2 where "Schema" has its first letter capitalized. I have tried running the following queries:

select * from Schema.table1;

Where I get the following error:

ERROR: relation "schema.table1" does not exist

I then tried running the next query thinking maybe the capitalization in the schema made a difference.

Select * from "Schema.table1"; 
select "ID" from "Schema.table1";

But the same error persisted:

ERROR: relation "Schema.table1" does not exist

I later tried to specify the schema path with "SET search_path to "Schema1" and ran a query on the tables which again provided me the same error. Any ideas or help would be greatly appreciated.


回答1:


Each element has to be quoted individually:

select "ID" 
from "Schema"."table1";

More details about quoted identifiers are in the manual



来源:https://stackoverflow.com/questions/48038502/i-keep-getting-the-error-relation-table-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!