How to use ON DUPLICATE KEY UPDATE in Postgresql with php

To do NOTHING on duplicate, simply dont run the first line. Note that this will always return a ‘success’ result for the Insert, it will simply affect 0 rows on duplicate.