Small patch for "CREATE TRIGGER" documentation

Started by Ian Lawrence Barwickalmost 13 years ago2 messages
#1Ian Lawrence Barwick
barwick@gmail.com
1 attachment(s)

I found this sentence somewhat confusing:

"It is possible for a column's value to change even when the trigger
is not fired,"

http://www.postgresql.org/docs/devel/static/sql-createtrigger.html#SQL-CREATETRIGGER-NOTES

More precise would be something along the lines "It is possible that
changes to the
column's value will not cause the trigger to be fired".

The attached patch hopefully rewords the entire paragraph for clarity.

Regards

Ian Barwick

Attachments:

create-trigger-doc-notes-2013-03-07.patchapplication/octet-stream; name=create-trigger-doc-notes-2013-03-07.patchDownload
diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml
new file mode 100644
index d9817e4..37d339d
*** a/doc/src/sgml/ref/create_trigger.sgml
--- b/doc/src/sgml/ref/create_trigger.sgml
*************** UPDATE OF <replaceable>column_name1</rep
*** 374,385 ****
     A column-specific trigger (one defined using the <literal>UPDATE OF
     <replaceable>column_name</replaceable></literal> syntax) will fire when any
     of its columns are listed as targets in the <command>UPDATE</>
!    command's <literal>SET</> list.  It is possible for a column's value
!    to change even when the trigger is not fired, because changes made to the
!    row's contents by <literal>BEFORE UPDATE</> triggers are not considered.
!    Conversely, a command such as <literal>UPDATE ... SET x = x ...</>
!    will fire a trigger on column <literal>x</>, even though the column's
!    value did not change.
    </para>
  
    <para>
--- 374,384 ----
     A column-specific trigger (one defined using the <literal>UPDATE OF
     <replaceable>column_name</replaceable></literal> syntax) will fire when any
     of its columns are listed as targets in the <command>UPDATE</>
!    command's <literal>SET</> list. Note that the trigger will fire even if the 
!    specified column's value did not change, for example when issuing a command 
!    such as <literal>UPDATE ... SET x = x ...</>. However, changes made to the
!    specified column by any <literal>BEFORE UPDATE</> triggers will not cause
!    the trigger to fire.
    </para>
  
    <para>
#2Robert Haas
robertmhaas@gmail.com
In reply to: Ian Lawrence Barwick (#1)
Re: Small patch for "CREATE TRIGGER" documentation

On Wed, Mar 6, 2013 at 7:27 PM, Ian Lawrence Barwick <barwick@gmail.com> wrote:

I found this sentence somewhat confusing:

"It is possible for a column's value to change even when the trigger
is not fired,"

http://www.postgresql.org/docs/devel/static/sql-createtrigger.html#SQL-CREATETRIGGER-NOTES

More precise would be something along the lines "It is possible that
changes to the
column's value will not cause the trigger to be fired".

The attached patch hopefully rewords the entire paragraph for clarity.

I guess I prefer the current version, personally.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs