title: Composite PRIMARY KEY enforces NOT NULL constraints on involved columns
body: <p>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.</p>
  
  <p>For example,</p>
  
  <pre><code>CREATE TABLE distributors (m_id integer, x_id integer, PRIMARY KEY(m_id, x_id));
  </code></pre>
  
  <p>enforces <code>NOT NULL</code> constraint on columns <code>m_id</code> and <code>x_id</code>, which I don't want!
  MySQL doesn't do this. I think Oracle doesn't do it as well.</p>
  
  <p>I understand that <code>PRIMARY KEY</code> enforces <code>UNIQUE</code> and <code>NOT NULL</code> automatically but that makes sense for single-column primary key. In a multi-column primary key table, the uniqueness is determined by the combination. </p>
  
  <p>Is there any simple way of avoiding this behavior of Postgres?<br>
  If I execute this:</p>
  
  <pre><code>CREATE TABLE distributors (m_id integer, x_id integer);
  </code></pre>
  
  <p>I do not get any <code>NOT NULL</code> constraints of course.     </p>