Re: 36.3 Writing Tigger Functions in C - Mailing list pgsql-docs

From Dmitry Igrishin
Subject Re: 36.3 Writing Tigger Functions in C
Date
Msg-id CAAfz9KO5WzJY0PH0CsWCTU9W7J09CB85kQT7sZX8AOr9srxgNA@mail.gmail.com
Whole thread Raw
In response to Re: 36.3 Writing Tigger Functions in C  (Marko Tiikkaja <marko@joh.to>)
List pgsql-docs


2015-08-11 14:32 GMT+03:00 Marko Tiikkaja <marko@joh.to>:
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.

pgsql-docs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: 36.3 Writing Tigger Functions in C
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot