aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/trigger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r--src/backend/commands/trigger.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 28c3dcd0f76..5ad18d2de4b 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -55,9 +55,11 @@
#include "utils/builtins.h"
#include "utils/bytea.h"
#include "utils/fmgroids.h"
+#include "utils/guc_hooks.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
+#include "utils/plancache.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
@@ -6500,6 +6502,20 @@ done:
}
/*
+ * GUC assign_hook for session_replication_role
+ */
+void
+assign_session_replication_role(int newval, void *extra)
+{
+ /*
+ * Must flush the plan cache when changing replication role; but don't
+ * flush unnecessarily.
+ */
+ if (SessionReplicationRole != newval)
+ ResetPlanCache();
+}
+
+/*
* SQL function pg_trigger_depth()
*/
Datum