PostgreSQL does not support MERGE at the moment, sorry.
Issue an UPDATE, and watch the rowcount ; if the rowcount is 0, issue an INSERT. Be prepared to retry if another transaction has inserted the row meanwhile, though.
MERGE would be really useful.