Skip site navigation (1) Skip section navigation (2)

Re: Serializable access giving wrong error messages?

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mikko Vierula <mikko(dot)vierula(at)elektroniikkatyo(dot)fi>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Serializable access giving wrong error messages?
Date: 2001-12-27 23:54:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Tom Lane wrote:
> Mikko Vierula <mikko(dot)vierula(at)elektroniikkatyo(dot)fi> writes:
> > But all
> > those errors really are because of serialization problems. So shouldn't
> > I be receiving a error stating that?
> I disagree, because I don't think it's reasonable to expect the system
> to make that deduction.  I prefer a specific error message telling you
> what's actually wrong ("duplicate key") to a vague error message that
> might in fact be incorrect (leaping to a "can't serialize access"
> conclusion).
> In the example you give, the reason that you as an intelligent human can
> classify the error as a serialization problem is that earlier in the
> transaction you searched for the key and didn't find it.  Had you not
> done that, you could not argue that "duplicate key" is the wrong message.

PostgreSQL doesn't need to remember the preceding operations
at all in order to judge if a "can't serialize access" error
is occurred.
In Mikko's both examples, Transaction 1 has to see a tuple
which didn't exist at the beginning of the transaction
while checking duplicate error.

Hiroshi Inoue

In response to


pgsql-bugs by date

Next:From: Tom LaneDate: 2001-12-28 00:21:40
Subject: Re: Serializable access giving wrong error messages?
Previous:From: Scott RoystonDate: 2001-12-27 22:28:29
Subject: Re: Implicit cast of literal in SQL statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group