diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index fc0a4b2fa7..d8890d2c74 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -1615,7 +1615,6 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid, SysScanDesc tgscan; ScanKeyData key; HeapTuple tuple; - int found PG_USED_FOR_ASSERTS_ONLY = 0; /* * Given a relation and the OID of a trigger on parent relation, find the @@ -1636,8 +1635,6 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid, if (tgform->tgparentid != parentTriggerOid) continue; /* not our trigger */ - Assert(found++ <= 0); - partitionRel = table_open(partitionId, NoLock); /* Rename the trigger on this partition */ @@ -1658,6 +1655,9 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid, } } table_close(partitionRel, NoLock); + + /* There should be at most one matching tuple */ + break; } systable_endscan(tgscan); }