title: Porting Oracle SQL to PostgreSQL - MERGE INTO
body: <p>What I'm mostly doing these days is converting an Oracle SQL database into a PostgreSQL (9.1.6) database.</p>
  
  <p>The most common issues that I tend to come across are as follows:</p>
  
  <pre><code>1. decode --&gt; case when
  2. nvl --&gt; coalesce
  3. (+) --&gt; outer join
  4. connect by prior --&gt; connectby function with tablefunc contrib module.
  5. merge into --&gt; ???
  etc...
  </code></pre>
  
  <p>I am currently skimming through the PostgreSQL manual and funnily enough there seems to be no <code>MERGE INTO</code> statement (or any direct substitutions for it).</p>
  
  <p>I am aware that PL/pgSQL could be used as an alternative but that would mean a lot of extra workload for me. Is there something that I'm missing about this?</p>