Re: BUG #8275: Updateable View based on inheritance (partition) throws Error on INSERT Statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8275: Updateable View based on inheritance (partition) throws Error on INSERT Statement
Date: 2013-07-03 16:29:54
Message-ID: 11683.1372868994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> On 2 July 2013 09:30, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>> I think the rewritten query should only use inheritance if inheritance
>> was requested in the original query, *and* if inheritance was enabled
>> in the view's query, per attached patch against HEAD.

> On second thoughts, I think this should only apply to INSERT.

> UPDATE and DELETE should continue work the same as SELECT, respecting
> the inheritance flag from the view query regardless of the inheritance
> flag in the outer query.

[ thinks for a bit... ] Yeah, I agree.

> Attached is an updated patch for HEAD, with regression tests. This
> should also be applied to the 9.3beta branch.

Applied with minor adjustments --- mainly, I took out the inFromCl
twiddling, which AFAICS is neither necessary (nothing downstream of this
looks at inFromCl) nor clearly correct.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message chad.wagner 2013-07-04 01:58:21 BUG #8279: Apparent memory leak with use of INTO STRICT in plpgsql?
Previous Message Pavel Stehule 2013-07-03 05:44:15 Re: BUG #8278: psql describe table