diff options
author | Michael Paquier | 2024-10-29 06:35:01 +0000 |
---|---|---|
committer | Michael Paquier | 2024-10-29 06:35:01 +0000 |
commit | 4b7bba49e71266ec378e672a1aaa9f16823449c2 (patch) | |
tree | 27bc29ad66f64f218657ef0644738d347b3155e6 /src/include/commands | |
parent | dda781609f977315c9ecdefc1e29f9499393aaa4 (diff) |
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
Diffstat (limited to 'src/include/commands')
-rw-r--r-- | src/include/commands/event_trigger.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/commands/event_trigger.h b/src/include/commands/event_trigger.h index 90fc1af5f69..00cfb397584 100644 --- a/src/include/commands/event_trigger.h +++ b/src/include/commands/event_trigger.h @@ -31,6 +31,12 @@ typedef struct EventTriggerData extern PGDLLIMPORT bool event_triggers; +/* + * Reasons for relation rewrites. + * + * pg_event_trigger_table_rewrite_reason() uses these values, so make sure to + * update the documentation when changing this list. + */ #define AT_REWRITE_ALTER_PERSISTENCE 0x01 #define AT_REWRITE_DEFAULT_VAL 0x02 #define AT_REWRITE_COLUMN_REWRITE 0x04 |