Re: Tables cannot have INSTEAD OF triggers - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Tables cannot have INSTEAD OF triggers
Date
Msg-id CAEZATCUc5h2H9bVaX2KvCm28WMXckVi=O3+qmhqPt2vGW4vOCw@mail.gmail.com
Whole thread Raw
In response to Re: Tables cannot have INSTEAD OF triggers  (Andres Freund <andres@anarazel.de>)
Responses Re: Tables cannot have INSTEAD OF triggers
List pgsql-hackers
On 1 April 2015 at 18:37, Andres Freund <andres@anarazel.de> wrote:
> On 2015-04-01 13:29:33 -0400, Tom Lane wrote:
>> As for partitioning, you could do this:
>>
>> create table parent(...);
>> create table child(...) inherits(parent); -- repeat as needed
>> create view v as select * from parent;
>> attach INSTEAD OF triggers to v
>>
>> Now the application deals only with v, and thinks that's the real
>> table.
>
> Sure, but that's just making things unnecessarily hard. That then
> requires also defining UPDATE/DELETE INSTEAD triggers which otherwise
> would just work.
>

No, because as defined above the view v would be auto-updatable, so
updates and deletes on v would just do the matching update/delete on
parent.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: How about to have relnamespace and relrole?
Next
From: Heikki Linnakangas
Date:
Subject: Re: Bug #10432 failed to re-find parent key in index