Re: triggers on views?
От | Bruce Momjian |
---|---|
Тема | Re: triggers on views? |
Дата | |
Msg-id | 200812160312.mBG3CWv09841@momjian.us обсуждение исходный текст |
Ответ на | Re: triggers on views? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-docs |
Tom Lane wrote: > Robert Treat <xzilla@users.sourceforge.net> 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 <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + 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>
В списке pgsql-docs по дате отправления: