On 2018-04-06 09:41:07 +0530, Amit Kapila wrote:
> >> Won't the same question applies to the similar usage in
> >> EvalPlanQualFetch and heap_lock_updated_tuple_rec.
> >
> > I don't think so?
> >
> >
> >> In EvalPlanQualFetch, we consider such a tuple to be deleted and will
> >> silently miss/skip it which seems contradictory to the places where we
> >> have detected such a situation and raised an error.
> >
> > 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")));
> >
> >
>
> I was talking about the case when the tuple version is not visible aka
> the below code:
> I think if we return an error in EvalPlanQualFetch at the place
> mentioned above, the behavior will be sane.
I think you're right. I've adapted the code, added a bunch of tests.
Greetings,
Andres Freund