title: What is the correct syntax to write "merge statement" in PostgreSQL 9.6.2
body: <p>code :It is merge query which is running on Postgres 9.6.2 and giving syntax error.</p>
  
  <pre><code>&lt;&lt;!--It is giving syntax error---&gt;
  MERGE INTO timesheets.timesheet_report AS tgt USING timesheets.tmp_timesheet_report AS src ON src.FMNo = tgt.FMNo
      AND src.ts_start_dt = tgt.ts_start_dt
      AND src.charge_code = tgt.charge_code WHEN NOT MATCHED
      INSERT (tgt.FIRST_NAME,
              tgt.LAST_NAME)
      VALUES(src.FIRST_NAME,
             src.LAST_NAME) WHEN MATCHED
      UPDATE
      SET tgt.FIRST_NAME = src.FIRST_NAME,
          tgt.LAST_NAME = src.LAST_NAME;
  </code></pre>