mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user