Re: UPDATE TRIGGER on view WAS: Re: Relation in tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: KeithW(at)narrowpathinc(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
Date: 2005-02-16 21:39:54
Message-ID: 28633.1108589994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

PFC <lists(at)boutiquenumerique(dot)com> writes:
> You can create an ON UPDATE/INSERT trigger on a view which intercepts the
> UPDATE/INSERT to the view (which would otherwise fail) and do whatever you
> want with it, including doing the operation on the real table.

This might work for INSERT but I really doubt it'll work for UPDATE or
DELETE.

You may be able to make it work with rules, though there are lots of
pitfalls in that approach.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-02-16 23:47:13 Re: Trigger
Previous Message PFC 2005-02-16 21:27:03 Re: Order of columns in a table important in a stored procedure?