为什么 Postgresql 说“模式不存在”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5829865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 22:56:14  来源:igfitidea点击:

Why does Postgresql say "schema does not exist"

postgresql

提问by Jaanus

How can i get this query to work?

我怎样才能让这个查询工作?

SELECT weather.id, cities.name, weather.date, weather.degree
FROM weather JOIN weather.city_id ON cities.id
WHERE weather.date = '2011-04-30';

ERROR: schema "weather" does not exist.

错误:架构“天气”不存在。

weather is not schema, it's a table!

天气不是模式,它是一张桌子!

回答by

perhaps:

也许:

SELECT weather.id, cities.name, weather.date, weather.degree 
FROM weather JOIN cities ON (weather.city_id = cities.id)
WHERE weather.date = '2011-04-30';

postgres is complaining about the join on weather.city_idwhich is interpreted as a table/view called 'city_id' in schema 'weather'

postgres 抱怨连接weather.city_id被解释为模式“天气”中名为“city_id”的表/视图