From 3b00a944a9b3847fb02dae7c9ea62fe0b211b396 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Tue, 12 Jul 2022 09:18:02 +0900 Subject: Support TRUNCATE triggers on foreign tables. Now some foreign data wrappers support TRUNCATE command. So it's useful to support TRUNCATE triggers on foreign tables for audit logging or for preventing undesired truncation. Author: Yugo Nagata Reviewed-by: Fujii Masao, Ian Lawrence Barwick Discussion: https://postgr.es/m/20220630193848.5b02e0d6076b86617a915682@sraoss.co.jp --- src/backend/commands/trigger.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/backend/commands/trigger.c') diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 13cb516752b..b8db53b66de 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -295,13 +295,6 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString, RelationGetRelationName(rel)), errdetail("Foreign tables cannot have INSTEAD OF triggers."))); - if (TRIGGER_FOR_TRUNCATE(stmt->events)) - ereport(ERROR, - (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("\"%s\" is a foreign table", - RelationGetRelationName(rel)), - errdetail("Foreign tables cannot have TRUNCATE triggers."))); - /* * We disallow constraint triggers to protect the assumption that * triggers on FKs can't be deferred. See notes with AfterTriggers -- cgit v1.2.3