Re: [HACKERS] Transition tables for triggers on foreign tables and views - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Transition tables for triggers on foreign tables and views
Date
Msg-id 15145.1493438178@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Transition tables for triggers on foreign tables and views  (Kevin Grittner <kgrittn@gmail.com>)
Responses Re: [HACKERS] Transition tables for triggers on foreign tables and views
List pgsql-hackers
Kevin Grittner <kgrittn@gmail.com> writes:
> Well, I was sort of hoping that the triggers that can now be defined
> but can never fire *did* fire at some point.

They will fire if you have an INSTEAD OF row-level trigger; the existence
of that trigger is what determines whether we implement DML on a view
through the view's own triggers or through translation to an action on
the underlying table.

I do not think it'd be reasonable to throw an error for creation of
a statement-level view trigger when there's no row-level trigger,
because that just imposes a hard-to-deal-with DDL ordering dependency.

You could make a case for having the updatable-view translation code
print a WARNING if it notices that there are statement-level triggers
that cannot be fired due to the translation.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] convert EXSITS to inner join gotcha and bug
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] some review comments on logical rep code