Composite PRIMARY KEY enforces NOT NULL constraints on involved columns
This is one strange, unwanted behavior I encountered in Postgres: When I create a Postgres table with composite primary keys, it enforces NOT NULL constraint on each column of the composite combination. For example, CREATE TABLE distributors (m_id integer, x_id integer, PRIMARY KEY(m_id, x_id)); enforces NOT NULL constraint on columns m_id and x_id , which I don't want! MySQL doesn't do this. I think Oracle doesn't do it as well. I understand that PRIMARY KEY enforces UNIQUE and NOT NULL automatically but that makes sense for single-column primary key. In a multi-column primary key table, the