Skip to content

Commit

Permalink
Fix the issue DISABLE trigger not work for instead of triggers (babel…
Browse files Browse the repository at this point in the history
…fish-for-postgresql#241)

* Fix the issue DISABLE trigger not work for instead of triggers

previously our support for ENABLE/DISABLE trigger syntax has a issue
that it's not working for instead of triggers. This commit fix this
issue.

Task: BABEL-3326
Signed-off-by: Zhibai Song <[email protected]>
  • Loading branch information
forestkeeper authored and Jason Teng committed Oct 26, 2023
1 parent 503e23f commit f889d8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/executor/nodeModifyTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ ExecInsert(ModifyTableContext *context,
return NULL; /* "do nothing" */
}
else if (sql_dialect == SQL_DIALECT_TSQL && resultRelInfo->ri_TrigDesc &&
resultRelInfo->ri_TrigDesc->trig_insert_instead_statement && !TsqlRecuresiveCheck(resultRelInfo)){
resultRelInfo->ri_TrigDesc->trig_insert_instead_statement &&
isTsqlInsteadofTriggerExecution(estate, resultRelInfo, TRIGGER_EVENT_INSERT))
{
ExecIRInsertTriggersTSQL(estate, resultRelInfo, slot, mtstate->mt_transition_capture);
// if it's a statement level IOT trigger, only get the transition table
if (canSetTag)
Expand Down

0 comments on commit f889d8d

Please sign in to comment.