diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/trigger.sgml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/src/sgml/trigger.sgml b/doc/src/sgml/trigger.sgml index 6f323a903b5..7d9ad4763aa 100644 --- a/doc/src/sgml/trigger.sgml +++ b/doc/src/sgml/trigger.sgml @@ -517,6 +517,7 @@ typedef struct TriggerData TupleTableSlot *tg_newslot; Tuplestorestate *tg_oldtable; Tuplestorestate *tg_newtable; + const Bitmapset *tg_updatedcols; } TriggerData; </programlisting> @@ -759,6 +760,30 @@ typedef struct Trigger </listitem> </varlistentry> + <varlistentry> + <term><structfield>tg_updatedcols</structfield></term> + <listitem> + <para> + For <literal>UPDATE</literal> triggers, a bitmap set indicating the + columns that were updated by the triggering command. Generic trigger + functions can use this to optimize actions by not having to deal with + columns that were not changed. + </para> + + <para> + As an example, to determine whether a column with attribute number + <varname>attnum</varname> (1-based) is a member of this bitmap set, + call <literal>bms_is_member(attnum - + FirstLowInvalidHeapAttributeNumber, + trigdata->tg_updatedcols))</literal>. + </para> + + <para> + For triggers other than <literal>UPDATE</literal> triggers, this will + be <symbol>NULL</symbol>. + </para> + </listitem> + </varlistentry> </variablelist> </para> |