Hello pgdevs,
The very minor patch attached improves the PL/pgSQL documentation about
trigger functions. It moves the description common to both data change &
database event triggers out of the first section and into a common header.
It adds a link at the beginning of the sections to their corresponding
generic chapters.
--
Fabien.diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index 7f23c2f..5d4080f 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -3660,18 +3660,26 @@ ASSERT condition , in PL/pgSQL
+
+ PL/pgSQL can be used to define trigger
+ procedures on data changes or database events.
+ A trigger procedure is created with the CREATE FUNCTION command,
+ declaring it as a function with no arguments and a return type of
+ trigger (for data change triggers) or
+ event_trigger (for database event triggers).
+ Special variables PG_something are automatically
+ available to test the condition which triggered the call.
+
+
Triggers on Data Changes
-
-PL/pgSQL can be used to define trigger
-procedures. A trigger procedure is created with the
-CREATE FUNCTION command, declaring it as a function with
-no arguments and a return type of trigger. Note that
-the function must be declared with no arguments even if it expects
-to receive arguments specified in CREATE TRIGGER —
-trigger arguments are passed via TG_ARGV, as described
-below.
+
+ A data change trigger is declared as a function
+ with no arguments and a return type of trigger.
+ Note that the function must be declared with no arguments even if it expects
+ to receive arguments specified in CREATE TRIGGER —
+ trigger arguments are passed via TG_ARGV, as described below.
@@ -4218,8 +4226,9 @@ SELECT * FROM sales_summary_bytime;
Triggers on Events
-PL/pgSQL can be used to define event
-triggers. PostgreSQL requires that a procedure that
+PL/pgSQL can be used to define
+event triggers.
+PostgreSQL requires that a procedure that
is to be called as an event trigger must be declared as a function with
no arguments and a return type of event_trigger.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers