X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 095508B9BD0 for ; Wed, 16 Feb 2005 21:40:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55353-09 for ; Wed, 16 Feb 2005 21:39:56 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id B07438B9B8F for ; Wed, 16 Feb 2005 21:39:57 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1GLdsjS028634; Wed, 16 Feb 2005 16:39:54 -0500 (EST) To: PFC Cc: KeithW@narrowpathinc.com, pgsql-sql@postgresql.org Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables In-reply-to: References: <20050216134301.5myrfpr3ck6bmswc@www.presserv.org> <20050216204358.M29214@narrowpathinc.com> Comments: In-reply-to PFC message dated "Wed, 16 Feb 2005 22:22:57 +0100" Date: Wed, 16 Feb 2005 16:39:54 -0500 Message-ID: <28633.1108589994@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/183 X-Sequence-Number: 20294 PFC 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