9.28. 事件觸發函式
PostgreSQL provides these helper functions to retrieve information from event triggers.
For more information about event triggers, see Chapter 39.
9.28.1. Capturing Changes at Command End
pg_event_trigger_ddl_commands
returns a list of DDL commands executed by each user action, when invoked in a function attached to a ddl_command_end
event trigger. If called in any other context, an error is raised. pg_event_trigger_ddl_commands
returns one row for each base command executed; some commands that are a single SQL sentence may return more than one row. This function returns the following columns:
9.28.2. Processing Objects Dropped by a DDL Command
pg_event_trigger_dropped_objects
returns a list of all objects dropped by the command in whose sql_drop
event it is called. If called in any other context, pg_event_trigger_dropped_objects
raises an error. pg_event_trigger_dropped_objects
returns the following columns:
The pg_event_trigger_dropped_objects
function can be used in an event trigger like this:
9.28.3. Handling a Table Rewrite Event
The functions shown in Table 9.96 provide information about a table for which a table_rewrite
event has just been called. If called in any other context, an error is raised.
Table 9.96. Table Rewrite Information
The pg_event_trigger_table_rewrite_oid
function can be used in an event trigger like this:
Last updated