Re: Normal errors codes in serializable transactions

From: Jon Smark <jon(dot)smark(at)yahoo(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Normal errors codes in serializable transactions
Date: 2013-05-09 11:02:12
Message-ID: 1368097332.36821.YahooMailNeo@web121004.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> In PostgreSQL, 40001 is used for serialization failures due to MVCC

> issues, and 40P01 is used for serialization failures due to
> deadlocks.  I think that many years back when PostgreSQL moved to
> MVCC it was judged important to differentiate between them with
> different SQLSTATE values because deadlocks tend to be somewhat
> more problematic.  Had I been involved with PostgreSQL at the time,
> I would have argued the value of staying with the standard
> serialization failure SQLSTATE (40001) for both, but it is unlikely
> to be changed at this point.  From the application perspective,
> both can (and generally should) be treated as meaning that there
> was nothing wrong with the transaction in itself; it only failed
> because of conflicts with one or more concurrent transactions and
> is likely to succeed if retried from the start.

Thank you very much for the prompt and informative reply!
That clears up my doubt.  For future reference: both 40001
and 40P01 are "normal" errors when issuing SERIALIZABLE
transactions in a concurrent setting...

Best,
Jon

In response to

Browse pgsql-general by date

  From Date Subject
Next Message itishree sukla 2013-05-09 11:03:17 Views
Previous Message Jon Smark 2013-05-09 10:53:04 Re: Normal errors codes in serializable transactions