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