doc: Add better description for rewrite functions in event triggers
authorMichael Paquier <[email protected]>
Tue, 29 Oct 2024 06:35:14 +0000 (15:35 +0900)
committerMichael Paquier <[email protected]>
Tue, 29 Oct 2024 06:35:14 +0000 (15:35 +0900)
commit709ce29b16569de7ed7d013399a6249849eaae40
tree95700aeba1282fd79d4a232eefd3f00ef8237b1d
parente5086b3ff4413fdd163c85a2ab5bfa26c7668cd3
doc: Add better description for rewrite functions in event triggers

There are two functions that can be used in event triggers to get more
details about a rewrite happening on a relation.  Both had a limited
documentation:
- pg_event_trigger_table_rewrite_reason() and
pg_event_trigger_table_rewrite_oid() were not mentioned in the main
event trigger section in the paragraph dedicated to the event
table_rewrite.
- pg_event_trigger_table_rewrite_reason() returns an integer which is a
bitmap of the reasons why a rewrite happens.  There was no explanation
about the meaning of these values, forcing the reader to look at the
code to find out that these are defined in event_trigger.h.

While on it, let's add a comment in event_trigger.h where the
AT_REWRITE_* are defined, telling to update the documentation when
these values are changed.

Backpatch down to 13 as a consequence of 1ad23335f36b, where this area
of the documentation has been heavily reworked.

Author: Greg Sabino Mullane
Discussion: https://postgr.es/m/CAKAnmmL+Z6j-C8dAx1tVrnBmZJu+BSoc68WSg3sR+CVNjBCqbw@mail.gmail.com
Backpatch-through: 13
doc/src/sgml/event-trigger.sgml
doc/src/sgml/func.sgml
src/include/commands/event_trigger.h