-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
> Attached is a patch to remove the upsert example from the pl/pgsql > documentation. It has a serious bug (see: > http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial > to fix. IMNSHO, our code examples should encourage good practices and > style. No, removing is a bad idea, as it's referenced from here to the North Pole and back. Better would simply be a warning about the non uniqueness of the unique constraint message. > The 'correct' way to do race free upsert is to take a table lock first > -- you don't have to loop or open a subtransaction. A high > concurrency version is nice but is more of a special case solution (it > looks like concurrent MERGE might render the issue moot anyways). I think anything doing table locks should be the "special case solution" as production systems generally avoid full table locks like the plague. The existing solution works fine as long as we explain that caveat (which is a little bit of a corner case, else we'd have heard more complaints before now). - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201008051402 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iEYEAREDAAYFAkxa/XgACgkQvJuQZxSWSsjTbACfcjrsBVXCOGUb6foARfNIztSo AswAn0bNttP8XOs/2tw6jFsSa0cZkq7e =HUcq -----END PGP SIGNATURE----- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers