I keep getting the error “relation [TABLE] does no

2019-01-09 19:36发布

问题:

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