Upsert Sample for Postgresql, Tested on 9.3