Re: BUG #16856: Crash when add "_RETURN" rule on child table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: todoubaba(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16856: Crash when add "_RETURN" rule on child table
Date: 2021-02-06 17:31:01
Message-ID: 192154.1612632661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> So my take is that this is an oversight in the CREATE RULE logic
> that allows converting a table to a view: if it has inheritance
> parents or children we must disallow doing that.

Come to think of it, applying ON INSERT/UPDATE/DELETE rules to
inheritance tree members is a bit problematic too. If you do
"UPDATE parent SET ..." then any ON UPDATE rules on the child
table are ignored (since the rewriter considers only "parent").
This probably doesn't lead to any system malfunctions, but
users might find it surprising. I bet we don't document that
adequately.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Piotr Włodarczyk 2021-02-07 01:18:38 Re: SV: Problem with pg_notify / listen
Previous Message Tom Lane 2021-02-06 17:20:25 Re: BUG #16856: Crash when add "_RETURN" rule on child table