aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/trigger.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-07-26 12:56:33 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-07-26 12:56:33 -0400
commit21b3aa9c8faf39ef45a5223681d8947e0a00e7da (patch)
tree23a0060bbfcd0e906e63e8a96aff8ceb90a481a2 /src/backend/commands/trigger.c
parentf68b609230689f9886a46e5d9ab8d6cdd947e0dc (diff)
downloadpostgresql-21b3aa9c8faf39ef45a5223681d8947e0a00e7da.tar.gz
postgresql-21b3aa9c8faf39ef45a5223681d8947e0a00e7da.zip
Remove newly added useless assertion check
Coverity complained that my commit 80ba4bb38353 added a dubious coding for a consistency check that there isn't more than one row for a certain tgrelid/tgparentid combination. But we don't check for that explicitly anywhere else, and if we were to do it, it should be a full shouldn't-happen elog not just an assert. It doesn't seem that this is very important anyway, so remove it. Discussion: https://postgr.es/m/1337562.1627224583@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r--src/backend/commands/trigger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index fc0a4b2fa73..d8890d2c748 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);
}