根据Postgres文档(http://www.
postgresql.org/docs/9.2/static/sql-createtable.html):
原文链接:https://www.f2er.com/postgresql/191817.htmlTechnically,PRIMARY KEY is merely a combination of UNIQUE and NOT
NULL,but identifying a set of columns as primary key also provides
Metadata about the design of the schema,as a primary key implies that
other tables can rely on this set of columns as a unique identifier
for rows.
从经验来看,我没有创造出许多表.没有主键的最大的缺点之一是,您可以通过外键没有参照完整性检查 – 因为该关系需要一个.我认为一些复制解决方案还需要一个主键,或者每行的单列标识符.