Re: [Bug] Inconsistent result for inheritance and FOR UPDATE.

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [Bug] Inconsistent result for inheritance and FOR UPDATE.
Date: 2014-12-15 02:33:25
Message-ID: 548E4875.8070109@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2014/12/13 1:17), Tom Lane wrote:
> Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-12-15 02:42:57 Re: replicating DROP commands across servers
Previous Message Michael Paquier 2014-12-15 02:26:44 Re: 9.5: Better memory accounting, towards memory-bounded HashAgg