title: PostgreSQL database - only insert if the record doesn't exist
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/7191902/cannot-select-from-update-returning-clause-in-postgres">Cannot SELECT from UPDATE RETURNING clause in postgres</a></p>
  </blockquote>
  
  <p>I am using a PostgreSQL database which has a &quot;company&quot; table and a &quot;country&quot; table which each have a uniqueID.</p>
  <p>I want a setup where if I try to add a company to the database, it only adds the company to the database with a new unique ID if it doesn't already exist.</p>