title: Changing a primary key to a composite primary key
body: <p>I've been using a "normal" (non-composite) primary key for one of my tables. Now I want to change it to a composite primary key. 
  My tables look something like this:</p>
  
  <pre><code>-- Table 1
  CREATE TABLE foo (
      id SERIAL PRIMARY KEY,
      id2 INT,
      ...
  )
  
  -- Table 2
  CREATE TABLE bar (
      id SERIAL PRIMARY KEY,
      id_foo INT REFERENCES foo (id)
  )
  </code></pre>
  
  <p>The problem here is that psql does not want to drop the old primary key, since other tables reference it. </p>
  
  <p>Is there any way of getting around this without dropping the whole database?</p>