Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group