Hi Samir,
Indeed, very unfortunately, PostgreSQL decided against implementing the SQL standard MERGE statement and implemented their own, vendor-specific alternative. One of the very few cases where PostgreSQL goes against the standard.
Thus, you cannot use jOOQ's MERGE statement.
Both MySQL's ON DUPLICATE KEY UPDATE clause (your example 2) and H2's MERGE statement can be emulated in PostgreSQL, though, at least if the primary key is known to jOOQ (e.g. when using the code generator). The upcoming jOOQ 3.9 will also add native support for PostgreSQL's ON CONFLICT clause:
Another alternative is to use plain SQL templating and add the ON CONFLICT clause in string form after the INSERT statement.
That's the current state.
Hope this helps,
Lukas