From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> |
Cc: | 691525127(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #15106: The AFTER trigger is created separately on view, and the DML operation can not trigger the trigger |
Date: | 2018-03-18 19:14:30 |
Message-ID: | 31020.1521400470@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> On Tue, Mar 13, 2018 at 9:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> When there's no INSTEAD OF trigger, the query is rewritten into an insert
>> on the view's base table (assuming the view is simple enough to be
>> auto-updatable), and we fire the base table's statement triggers, not the
>> view's. I'm pretty sure this is intentional, though I couldn't find it
>> mentioned in the manual either. Firing both sets of statement triggers
>> would be confusing, and not firing the base table's triggers would
>> perhaps miss processing that needs to happen.
> We also discussed this here:
> We resolved the main issue in that thread but we didn't do anything
> about this side issue. You and Kevin both suggested that perhaps we
> shouldn't allow you to create such unfireable triggers, or perhaps we
> should raise a warning, or at least document the (IMHO) confusing
> behaviour.
A simple approach to raising an error or warning would create hazards
for pg_dump, ie it'd need to make sure the INSTEAD OF trigger was restored
first. We could get around that no doubt, but I don't think it's worth
the work, at least not unless we get a lot more complaints. For the
moment a documentation improvement seems sufficient, so I've pushed one.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2018-03-18 19:59:45 | BUG #15121: Multiple UBSAN errors |
Previous Message | Michael Paquier | 2018-03-18 13:49:43 | Re: BUG #15116: pg_recvlogical always fails |