Some days ago, i had to to implement an upsert and used a a /LOCK TABLE/ to prevent the race conditions. Working fine for the moment. http://www.joocom.de/blog/postgresql-insert-und-update-in-einem-statement/ <http://www.joocom.de/blog/postgresql-insert-und-update-in-einem-statement/> -- View this message in context: http://postgresql.1045698.n5.nabble.com/upsert-functionality-tp5755712p5788365.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general