diff options
author | Fujii Masao <fujii@postgresql.org> | 2022-07-12 09:18:02 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2022-07-12 09:18:02 +0900 |
commit | 3b00a944a9b3847fb02dae7c9ea62fe0b211b396 (patch) | |
tree | a2abdd3d3fe79c4ac2133d2933f01d9ecc0d5bfa /src/backend/commands/trigger.c | |
parent | 14168d3c62fa90f1ec447f873f0e4df16a57a717 (diff) | |
download | postgresql-3b00a944a9b3847fb02dae7c9ea62fe0b211b396.tar.gz postgresql-3b00a944a9b3847fb02dae7c9ea62fe0b211b396.zip |
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
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 7 |
1 files changed, 0 insertions, 7 deletions
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 |