【发布时间】:2020-02-27 15:52:55
【问题描述】:
我在一个学校项目中使用 PostgreSQL,我正在尝试向我的数据库表中添加不同的外键,但是当我运行时:
ALTER TABLE PARTSUPP ADD FOREIGN KEY (PS_SUPPKEY) REFERENCES SUPPLIER(S_SUPPKEY);
在 SQL shell 上,我收到以下错误消息:
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
希望你能帮我解决这个问题!
【问题讨论】:
-
您的确切 Postgres 版本是什么?
select version();会告诉你 -
PostgreSQL 12.1
标签: sql postgresql ddl