title: Insert INTO where clause on postgresql
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1109061/insert-on-duplicate-update-postgresql">Insert, on duplicate update (postgresql)</a>  </p>
  </blockquote>
  
  
  
  <p>Is this possible on PostgreSQL:</p>
  
  <pre><code>insert record, if the record doesn't exists
  else update existing record
  </code></pre>
  
  <p>Supposedly that the record will be inserted in this table structure:</p>
  
  <pre><code>[userid - unique] [count]
  </code></pre>
  
  <p>If there was an existing record, I will just update the count or insert if it doesn't exists</p>