pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: PFC <lists@boutiquenumerique.com>
Cc: KeithW@narrowpathinc.com
Cc: pgsql-sql@postgresql.org
Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
Date: Wed, 16 Feb 2005 16:39:54 -0500
Message-ID: <28633.1108589994@sss.pgh.pa.us> (raw)
In-Reply-To: <opsma60jw9th1vuj@musicbox>
References: <20050216134301.5myrfpr3ck6bmswc@www.presserv.org>
	<opsmaz8b14th1vuj@musicbox>
	<20050216204358.M29214@narrowpathinc.com>
	<opsma60jw9th1vuj@musicbox>

PFC <lists@boutiquenumerique.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



view thread (3+ messages)

Message-ID: <28633.1108589994@sss.pgh.pa.us>
Permalink:  ../28633.1108589994@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28633.1108589994@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lists@boutiquenumerique.com, KeithW@narrowpathinc.com
  Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
  In-Reply-To: <28633.1108589994@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox