Re: what are rules for? - Mailing list pgsql-general

From Michael Shulman
Subject Re: what are rules for?
Date
Msg-id c3f821000806251022m3db832f7s286c429d723de5ef@mail.gmail.com
Whole thread Raw
In response to Re: what are rules for?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: what are rules for?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, Jun 24, 2008 at 11:08 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> To expand on that: it's pretty hard to see how update or delete triggers
> on a view would work.  Insert is easy, because if left to its own
> devices the system would in fact try to insert a tuple into the view
> relation, and that action could fire a trigger which could redirect the
> insertion someplace else.  But updates and deletes require a
> pre-existing target tuple, and there just aren't any of those in a view
> relation.  (Another way to say it is that update/delete require a CTID
> column, which a view hasn't got.)

But isn't the CTID column only required in order for the executor to
actually *do* the update or delete?  And since with a view, there is
nothing to actually update or delete in the view itself, the trigger
would be doing the only actual updating or deleting, so where would
the CTID column be needed?

Perhaps this is the same as the "instead trigger" suggestion -- I'm
not familiar with Oracle.

Mike

pgsql-general by date:

Previous
From: David Siebert
Date:
Subject: Re: Probably been asked a hundred times before.
Next
From: Andrew
Date:
Subject: 0xc3 error Text Search Windows French