Add support for REINDEX in event triggers
authorMichael Paquier
Mon, 4 Dec 2023 00:53:49 +0000 (09:53 +0900)
committerMichael Paquier
Mon, 4 Dec 2023 00:53:49 +0000 (09:53 +0900)
commitf21848de20130146bc8039504af40bd24add54cd
treeb2c95265c2ee21f151e0d5a38778adef649d451b
parentd78b6cbb602f5c36db3e267e2713b3aa22c815a5
Add support for REINDEX in event triggers

This commit adds support for REINDEX in event triggers, making this
command react for the events ddl_command_start and ddl_command_end.  The
indexes rebuilt are collected with the ReindexStmt emitted by the
caller, for the concurrent and non-concurrent paths.

Thanks to that, it is possible to know a full list of the indexes that a
single REINDEX command has worked on.

Author: Garrett Thornburg, Jian He
Reviewed-by: Jim Jones, Michael Paquier
Discussion: https://postgr.es/m/CAEEqfk5bm32G7sbhzHbES9WejD8O8DCEOaLkxoBP7HNWxjPpvg@mail.gmail.com
doc/src/sgml/event-trigger.sgml
src/backend/catalog/index.c
src/backend/commands/cluster.c
src/backend/commands/indexcmds.c
src/backend/commands/tablecmds.c
src/backend/tcop/utility.c
src/include/catalog/index.h
src/include/tcop/cmdtaglist.h
src/test/regress/expected/event_trigger.out
src/test/regress/sql/event_trigger.sql