title: how to emulate "insert ignore" and "on duplicate key update" (sql merge) with postgresql?
body: <p>Some SQL servers have a feature where <code>INSERT</code> is skipped if it would violate a primary/unique key constraint. For instance, MySQL has <code>INSERT IGNORE</code>.</p>
  
  <p>What's the best way to emulate <code>INSERT IGNORE</code> and <code>ON DUPLICATE KEY UPDATE</code> with PostgreSQL?</p>