Re: SSI predicate locking on heap -- tuple or row? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SSI predicate locking on heap -- tuple or row?
Date
Msg-id 12537.1306160421@sss.pgh.pa.us
Whole thread Raw
In response to Re: SSI predicate locking on heap -- tuple or row?  (Aidan Van Dyk <aidan@highrise.ca>)
Responses Re: SSI predicate locking on heap -- tuple or row?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Aidan Van Dyk <aidan@highrise.ca> writes:
> So, if SSI conflicts something on the UPDATE case, it would necessrily
> have to conflict the DELETE+INSERT case as well, and vice-versa.

This argument is fundamentally bogus, because an UPDATE is not the same
thing as DELETE followed by INSERT.  In the former case the new tuple
will have a ctid link from the old one; in the latter case not.  And
that will affect the behavior of subsequent operations.  Another
user-visible difference is that if the table has OIDs, the latter case
will (usually) give the new tuple a different OID.  Or if you don't like
OIDs, think about a serial column.  Or an ON INSERT trigger with
side-effects.

It may be that the result Kevin seeks to prove is in fact true, but an
argument that requires the assumption that UPDATE is indistinguishable
from DELETE+INSERT isn't going to persuade me, because I don't have any
trouble whatsoever in distinguishing them.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Aidan Van Dyk
Date:
Subject: Re: SSI predicate locking on heap -- tuple or row?
Next
From: Robert Haas
Date:
Subject: Re: 9.1 support for hashing arrays