[DOCS] 36.1 Overview of Trigger Behavior

2015-08-11 Thread Dmitry Igrishin
Subparagraph 8:
I suggest to replace
"BEFORE row-level triggers to execute"
with
"row-level BEFORE triggers to execute"
for consistency.

Subparagraph 14:
While WHEN can be used with INSERT too, I suggest to replace
"However, in an AFTER trigger, the WHEN condition is
evaluated just after the row update occurs, and it determines
whether an event is queued to fire the trigger at the end of
statement."
with
"However, in an AFTER trigger, the WHEN condition is
evaluated just after the row inserted or updated, and it determines
whether an event is queued to fire the trigger at the end of
statement."

-- 
// Dmitry.


[DOCS] 36.2 Visibility of Data Changes

2015-08-11 Thread Dmitry Igrishin
Subparagraph 1:
I suggest to replace
"Statement-level triggers follow simple visibility rules: none of the
changes made by a statement are visible to statement-level
triggers that are invoked before the statement, whereas all
modifications are visible to statement-level AFTER triggers."
with
"Statement-level triggers follow simple visibility rules: none of the
changes made by a statement are visible to statement-level
BEFORE triggers, whereas all modifications are visible to
statement-level AFTER triggers."

-- 
// Dmitry.


[DOCS] 36.3 Writing Tigger Functions in C

2015-08-11 Thread Dmitry Igrishin
Subparagparh 3:
I suggest to replace:
"but it is passed a "context" pointer pointing to a TriggerData
structure"
with
"but it is passed a "context" pointer to a structure of type
TriggerData"

tg_trigtuple:
I'm not sure why "skip the operation" is here:
"if you don't want to replace the row with a different one (in the
case of INSERT) or skip the operation"

tg_newtuple:
I'm not sure why "skip the operation" is here:
"and you don't want to replace this row by a different one or
skip the operation"

and I suggest to replace:
"and you don't want to replace this row by a different one"
with
"and you don't want to replace the row with a different one"
anyway.

-- 
// Dmitry.


[DOCS] "SQL null" vs "SQL NULL".

2015-08-11 Thread Dmitry Igrishin
I've noticed that there are both of "SQL null" and "SQL NULL" are
presents. I'm not sure what is more correct, but I think it would be
better to make it consistent.

-- 
// Dmitry.


Re: [DOCS] 36.3 Writing Tigger Functions in C

2015-08-11 Thread Dmitry Igrishin
2015-08-11 13:47 GMT+03:00 Dmitry Igrishin :

> Subparagparh 3:
> I suggest to replace:
> "but it is passed a "context" pointer pointing to a TriggerData
> structure"
> with
> "but it is passed a "context" pointer to a structure of type
> TriggerData"
>
Oops, it's even better to replace with
"but it is passed a "context" pointer", because the need of
use CALLED_AS_TRIGGER macro described hereinafter.


-- 
// Dmitry.


Re: [DOCS] 36.3 Writing Tigger Functions in C

2015-08-11 Thread Marko Tiikkaja

On 8/11/15 12:47 PM, Dmitry Igrishin wrote:

tg_trigtuple:
I'm not sure why "skip the operation" is here:
"if you don't want to replace the row with a different one (in the
case of INSERT) or skip the operation"


Returning NULL from a row-level BEFORE trigger skips the operation which 
fired the trigger.  So for an INSERT, any triggers which would otherwise 
fire after the current trigger are not fired, and the row is not 
INSERTed into the table.



.m


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


Re: [DOCS] 36.3 Writing Tigger Functions in C

2015-08-11 Thread Dmitry Igrishin
2015-08-11 14:32 GMT+03:00 Marko Tiikkaja :

> On 8/11/15 12:47 PM, Dmitry Igrishin wrote:
>
>> tg_trigtuple:
>> I'm not sure why "skip the operation" is here:
>> "if you don't want to replace the row with a different one (in the
>> case of INSERT) or skip the operation"
>>
>
> Returning NULL from a row-level BEFORE trigger skips the operation which
> fired the trigger.  So for an INSERT, any triggers which would otherwise
> fire after the current trigger are not fired, and the row is not INSERTed
> into the table.

Yes, but it's absolutely unclear in this place of the documentation.
Thus,
"If this trigger was fired for an INSERT or DELETE then this is what you
should return from the function if you don't want to replace the row with a
different one (in the case of INSERT) or skip the operation."
should be replaced with something like
"If this trigger was fired for an INSERT or DELETE then this is what you
should return from the function if you don't want to replace the row with a
different one (in the case of INSERT). (To skip the operation you should
return NULL.)" ?

-- 
// Dmitry.