举个例子
create table indexing_table
(
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
);
下列表格之间有区别吗?
表1:
create table referencing_table
(
indexing_table_id INTEGER references indexing_table
);
表2:
create table referencing_table
(
indexing_table_id INTEGER references indexing_table NOT NULL
);
或者,在没有NOT NULL
约束的表1中,我们是否可以插入包含NULL
个值的记录?