Re: [GENERAL] PL/pgSQL infinite loop in "UPDATE/INSERT" example

2009-08-25 Thread Tom Lane
Michael Brown writes: > I believe that Example 38-2 ("Exceptions with UPDATE/INSERT") in the PL/pgSQL > documentation suffers from a race condition leading to a potential infinite > loop when running at isolation level SERIALIZABLE. You're right, it's not designed to work in serializable mode.

[GENERAL] PL/pgSQL infinite loop in "UPDATE/INSERT" example

2009-08-25 Thread Michael Brown
Hi, I believe that Example 38-2 ("Exceptions with UPDATE/INSERT") in the PL/pgSQL documentation suffers from a race condition leading to a potential infinite loop when running at isolation level SERIALIZABLE. Here's the relevant code, for reference (copied straight from the 8.4 documentation):