Hi!
>It sounds like this should be re-written as 'insert on conflict do update' statement.
It should work in Postgres 9 also. on confilct is not available in postgres 9.
This code does not insert duplicate key valuse ? Why it throws error ?
You can create testcase to run this code from multiple processes
to try reproduce the error.
Andrus.