Re: [Bug] Inconsistent result for inheritance and FOR UPDATE. - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: [Bug] Inconsistent result for inheritance and FOR UPDATE.
Date
Msg-id 548E4875.8070109@lab.ntt.co.jp
Whole thread Raw
In response to Re: [Bug] Inconsistent result for inheritance and FOR UPDATE.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Bug] Inconsistent result for inheritance and FOR UPDATE.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
(2014/12/13 1:17), Tom Lane wrote:
> Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> writes:
>>> (2014/12/12 10:37), Tom Lane wrote:
>>>> Yeah, this is clearly a thinko: really, nothing in the planner should
>>>> be using get_parse_rowmark().  I looked around for other errors of the
>>>> same type and found that postgresGetForeignPlan() is also using
>>>> get_parse_rowmark().  While that's harmless at the moment because we
>>>> don't support foreign tables as children, it's still wrong.

>> In order
>> to get the locking strength, I think we need to see the RowMarkClauses
>> and thus still need to use get_parse_rowmark() in
>> postgresGetForeignPlan(), though I agree with you that that is ugly.

> I think this needs more thought; I'm still convinced that having the FDW
> look at the parse rowmarks is the Wrong Thing.  However, we don't need
> to solve it in existing branches.  With 9.4 release so close, the right
> thing is to revert that change for now and consider a HEAD-only patch
> later.

OK

> (One idea is to go ahead and make a ROW_MARK_COPY item, but
> add a field to PlanRowMark to record the original value.

+1

> We should
> probably also think about allowing FDWs to change these settings if
> they want to.

This is not clear to me.  Maybe I'm missing something, but I think that
the FDW only needs to look at the original locking strength in
GetForeignPlan().  Please explain that in a little more detail.

Thanks,

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Next
From: Michael Paquier
Date:
Subject: Re: replicating DROP commands across servers