title: Create table as in Redshift defining primary key
body: <p>I am trying to replicate a table using CTAS clause in redshift by additionally specifying a primary key to the table.</p>
  
  <p>Tried below syntax but no luck. However, I was able to specify DISTKEY/SORTKEY using the same syntax</p>
  
  <pre><code>create table date_dim
  PRIMARY KEY(date_key)
  --DISTKEY ( date_key )
  as
     select date_key,
     calendar_date,.....;
  </code></pre>
  
  <p>I want to use primary key as part of merge logic I am designing in my flow.</p>
  
  <p>TIA!</p>