将外键添加到表中

问题描述 投票:0回答:1

我在学校项目中使用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.

我希望您能帮助我解决这个问题!

sql postgresql ddl
1个回答
0
投票
运行您的语句时,您的PostgreSQL服务器崩溃。 Postgres日志中可能会有更多信息。
© www.soinside.com 2019 - 2024. All rights reserved.