summaryrefslogtreecommitdiff
path: root/src/backend/tcop
diff options
context:
space:
mode:
authorMichael Paquier2023-12-04 00:53:49 +0000
committerMichael Paquier2023-12-04 00:53:49 +0000
commitf21848de20130146bc8039504af40bd24add54cd (patch)
treeb2c95265c2ee21f151e0d5a38778adef649d451b /src/backend/tcop
parentd78b6cbb602f5c36db3e267e2713b3aa22c815a5 (diff)
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
Diffstat (limited to 'src/backend/tcop')
-rw-r--r--src/backend/tcop/utility.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index e3ccf6c7f7e..366a27ae8ed 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -960,10 +960,6 @@ standard_ProcessUtility(PlannedStmt *pstmt,
(RecoveryInProgress() ? 0 : CHECKPOINT_FORCE));
break;
- case T_ReindexStmt:
- ExecReindex(pstate, (ReindexStmt *) parsetree, isTopLevel);
- break;
-
/*
* The following statements are supported by Event Triggers only
* in some cases, so we "fast path" them in the other cases.
@@ -1574,6 +1570,13 @@ ProcessUtilitySlow(ParseState *pstate,
}
break;
+ case T_ReindexStmt:
+ ExecReindex(pstate, (ReindexStmt *) parsetree, isTopLevel);
+
+ /* EventTriggerCollectSimpleCommand is called directly */
+ commandCollected = true;
+ break;
+
case T_CreateExtensionStmt:
address = CreateExtension(pstate, (CreateExtensionStmt *) parsetree);
break;