pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: KeithW@narrowpathinc.com
To: pgsql-sql@postgresql.org
Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
Date: Wed, 16 Feb 2005 22:22:57 +0100
Message-ID: <opsma60jw9th1vuj@musicbox> (raw)
In-Reply-To: <20050216204358.M29214@narrowpathinc.com>
References: <20050216134301.5myrfpr3ck6bmswc@www.presserv.org>
	<opsmaz8b14th1vuj@musicbox>
	<20050216204358.M29214@narrowpathinc.com>



> And all this time I thought that you couldn't write to a view.

	You can't.
	But you can make it seem so you can.

	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.

	Search for "postgresql materialized views" for some examples.



view thread (3+ messages)  latest in thread

Message-ID: <opsma60jw9th1vuj@musicbox>
Permalink:  ../opsma60jw9th1vuj@musicbox/
Also on:    postgresql.org/message-id/opsma60jw9th1vuj@musicbox

 · 

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: lists@boutiquenumerique.com, KeithW@narrowpathinc.com
  Subject: Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
  In-Reply-To: <opsma60jw9th1vuj@musicbox>

* 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