title: How to copy a table schema with sql based on existance of the table?
body: <p>I want to duplicate a table schema, but only if the target table does not yet exist:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS my_table_secondary as select * from my_table_primary
  </code></pre>
  
  <p>Problem: running this if the <code>my_secondary_table</code> exists results in:
  <code>ERROR: Syntaxerror at "as"</code>.</p>
  
  <p>What could I do to make this sql statement work?
  (postgres 9.4)</p>