title: Redshift : defining composite primary key
body: <p>I have a table for which I want to define a composite primary key with two columns in redshift. I am having some trouble with create table syntax. Here is what I am trying to do :</p>
  
  <pre>
  Create table metrics  (
       id varchar(30),
       runtime timestamp,
       category varchar(30),
       location varchar(30))
  primary key(id, runtime),
  sortkey(runtime);
  </pre>
  
  <p>It is failing with a message : </p>
  
  <pre>
  ERROR:  syntax error at or near "PRIMARY"
  </pre>
  
  <p>Can anyone please help me figure out how to fix it? Thanks in advance.</p>