public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: Tom Lane <[email protected]>
Cc: Robert Treat <[email protected]>
Cc: [email protected]
Subject: Re: triggers on views?
Date: Mon, 15 Dec 2008 22:12:32 -0500 (EST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Tom Lane wrote:
> Robert Treat <[email protected]> writes:
> > We had a doc comment come in noting that the second paragraph seems to be 
> > incorrect on 
> > http://www.postgresql.org/docs/8.3/interactive/rules-triggers.html, 
> > specifically the part that says "On the other hand, a trigger that is fired 
> > on INSERT on a view can do the same as a rule".
> 
> This was discussed last month:
> http://archives.postgresql.org/pgsql-general/2008-06/msg00669.php

OK, updated wording applied to CVS HEAD; attached.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +


Attachments:

  [text/x-diff] /rtmp/diff2 (1.1K, 2-%2Frtmp%2Fdiff2)
  download | inline diff:
Index: doc/src/sgml/rules.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/rules.sgml,v
retrieving revision 1.51
diff -c -c -r1.51 rules.sgml
*** doc/src/sgml/rules.sgml	1 Feb 2007 19:10:24 -0000	1.51
--- doc/src/sgml/rules.sgml	16 Dec 2008 03:10:55 -0000
***************
*** 1869,1881 ****
  </para>
  
  <para>
!     On the other hand, a trigger that is fired on
!     <command>INSERT</command> on a view can do the same as a rule: put
!     the data somewhere else and suppress the insert in the view. But
!     it cannot do the same thing on <command>UPDATE</command> or
!     <command>DELETE</command>, because there is no real data in the
!     view relation that could be scanned, and thus the trigger would
!     never get called. Only a rule will help.
  </para>
  
  <para>
--- 1869,1877 ----
  </para>
  
  <para>
!     On the other hand, a trigger cannot be created on views because
!     there is no real data in a view relation;  however INSERT, UPDATE,
!     and DELETE rules can be created on views.
  </para>
  
  <para>


view thread (3+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: triggers on views?
  In-Reply-To: <[email protected]>

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

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