public inbox for [email protected]  
help / color / mirror / Atom feed
triggers on views?
3+ messages / 3 participants
[nested] [flat]

* triggers on views?
@ 2008-07-15 02:42 Robert Treat <[email protected]>
  2008-07-15 14:01 ` Re: triggers on views? Tom Lane <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Robert Treat @ 2008-07-15 02:42 UTC (permalink / raw)
  To: pgsql-docs

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".  I'm not sure if this is 
supposed to just be taken as a conceptual argument, but it is confusing 
because you can't put insert triggers on views... so just what is it getting 
at? This exists in several versions back, not sure how folks feel about 
updating existing versions, but seems like it could use some rewording... 
thoughts? 

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: triggers on views?
  2008-07-15 02:42 triggers on views? Robert Treat <[email protected]>
@ 2008-07-15 14:01 ` Tom Lane <[email protected]>
  2008-12-16 03:12   ` Re: triggers on views? Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2008-07-15 14:01 UTC (permalink / raw)
  To: Robert Treat <[email protected]>; +Cc: pgsql-docs

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

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: triggers on views?
  2008-07-15 02:42 triggers on views? Robert Treat <[email protected]>
  2008-07-15 14:01 ` Re: triggers on views? Tom Lane <[email protected]>
@ 2008-12-16 03:12   ` Bruce Momjian <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2008-12-16 03:12 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Robert Treat <[email protected]>; pgsql-docs

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>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2008-12-16 03:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-15 02:42 triggers on views? Robert Treat <[email protected]>
2008-07-15 14:01 ` Tom Lane <[email protected]>
2008-12-16 03:12   ` Bruce Momjian <[email protected]>

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