Re: [HACKERS] Restrict concurrent update/delete with UPDATE ofpartition key - Mailing list pgsql-hackers

From amul sul
Subject Re: [HACKERS] Restrict concurrent update/delete with UPDATE ofpartition key
Date
Msg-id CAAJ_b94X5Y_zdTN=BGdZie+hM4p6qW70-XCJhFYaCUO0OfF=aQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Restrict concurrent update/delete with UPDATE ofpartition key  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [HACKERS] Restrict concurrent update/delete with UPDATE ofpartition key  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Fri, Apr 6, 2018 at 1:19 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Fri, Apr 6, 2018 at 12:50 PM, amul sul <sulamul@gmail.com> wrote:
>>
>> Updated patch attached.
>>
>
> + if (ItemPointerIndicatesMovedPartitions(&hufd.ctid))
> + ereport(ERROR,
> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> + errmsg("tuple to be locked was already moved to another partition
> due to concurrent update")));
>
> As suggested by Andres, I think you should change the error code to
> serialization failure i.e ERRCODE_T_R_SERIALIZATION_FAILURE.
>

Thanks for the reminder -- fixed in the attached version.

Regards,
Amul

Attachment

pgsql-hackers by date:

Previous
From: Ernst-Georg Schmid
Date:
Subject: AW: Get the name of the target Relation from Query struct?
Next
From: David Rowley
Date:
Subject: Re: Get the name of the target Relation from Query struct?