On 2022-Aug-19, Justin Pryzby wrote: > That would be a memory leak or some other bug, except that it also seems to be > dead code ? > > https://coverage.postgresql.org/src/backend/commands/trigger.c.gcov.html#1166 > > Is it somwhow possible to call CreateTrigger() to create a FOR EACH ROW > trigger, with an index, and not internally ?
TBH I don't remember this at all anymore. So apparently the way to get a trigger associated with a relation (tgconstrrelid) is via CREATE CONSTRAINT TRIGGER, but there doesn't appear to be a way to have it associated with a specific *index* on that relation (tgconstrindid). So you're right that it appears to be dead code. If the regression tests don't break by removing it, I agree with doing that. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La libertad es como el dinero; el que no la sabe emplear la pierde" (Alvarez)