在没有模式的名称的不同模式的PostgreSQL中加入两个表格
如何在没有模式名称的情况下在不同的模式中加入两个表?
考虑两个模式,有人桌的用户和带宠物桌的动物。 人和宠物桌具有相同的列ID_Person。
如果我运行此查询:
SELECT pet.name FROM person p
INNER JOIN pet a ON p.id_person = a.id_person
我会收到此错误:“错误:关系“人”不存在”。
我知道我可以为人和宠物指定架构,这是作品,但是在另一种情况下,我看到了没有模式名称的此类查询。
我也知道该模式没有任何看法。
感谢您的帮助。
How it's possible to join two tables in different schemas without the schema's name?
Consider two schemas, USERS with Person table and ANIMALS with Pet Table.
Person and Pet tables have the same column id_person.
If I run this query:
SELECT pet.name FROM person p
INNER JOIN pet a ON p.id_person = a.id_person
I get this error: "ERROR: relation "person" does not exist".
I know that I can specify the schema for Person and Pet, and it's works, but in an other case I've seen a query like this work without schemas name.
I know also that the schemas have no views.
Thanks for your helping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论