As an example
create table indexing_table
(
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
);
Is there any difference between the following tables?
Table 1:
create table referencing_table
(
indexing_table_id INTEGER references indexing_table
);
Table 2:
create table referencing_table
(
indexing_table_id INTEGER references indexing_table NOT NULL
);
Alternatively, in the case of table 1, where there is no restriction NOT NULL, is it allowed to insert records containing values NULL?
source
share