"Chris White" <cjwhite@cisco.com> writes:
> The first and second are over the same connection. The third is over a
> different connection, but issued after the second transaction has completed.
Oh? At this point I'm prepared to bet that the second transaction isn't
really committed when you think it is. Perhaps the "COMMIT" command
isn't getting flushed out to the backend on time. You might want to
turn on query logging and watch to see exactly what happens when.
regards, tom lane