通过 pgAdmin 在 PostgreSQL 中创建关系链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9793536/
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
Creating relationship links in PostgreSQL via pgAdmin
提问by Mr Teeth
I created a databse with four tables in pgAdmin. It was coded in PostgreSQL.
我在 pgAdmin 中创建了一个包含四个表的数据库。它是用 PostgreSQL 编码的。
I was wondering how do you create replationship links in pgAdmin? I've searched google and youtube, but can't seem to find a tutorial on it.
我想知道如何在 pgAdmin 中创建复制链接?我已经搜索了 google 和 youtube,但似乎找不到关于它的教程。
If someone can explain how to do this, i'll be grateful.
如果有人可以解释如何做到这一点,我将不胜感激。
Here's a picture of how I designed my datase to relate:
这是我如何设计我的数据以进行关联的图片:
回答by DrColossos
You can find it via right-click on the table --> Properties --> Constraints --> Foreign Key (Add)
.
您可以通过右键单击表格找到它--> Properties --> Constraints --> Foreign Key (Add)
。
Then you can add the foreign keys as needed. There is (yet) no way to do it graphically.
然后您可以根据需要添加外键。(还)没有办法以图形方式做到这一点。