mirror of
https://github.com/postgres/postgres.git
synced 2025-10-13 18:28:01 +03:00
Support statement-level ON TRUNCATE triggers. Simon Riggs
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.271 2008/03/26 21:10:39 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.272 2008/03/28 00:21:56 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -499,6 +499,13 @@ pg_get_triggerdef(PG_FUNCTION_ARGS)
|
||||
else
|
||||
appendStringInfo(&buf, " UPDATE");
|
||||
}
|
||||
if (TRIGGER_FOR_TRUNCATE(trigrec->tgtype))
|
||||
{
|
||||
if (findx > 0)
|
||||
appendStringInfo(&buf, " OR TRUNCATE");
|
||||
else
|
||||
appendStringInfo(&buf, " TRUNCATE");
|
||||
}
|
||||
appendStringInfo(&buf, " ON %s ",
|
||||
generate_relation_name(trigrec->tgrelid));
|
||||
|
||||
|
Reference in New Issue
Block a user