Re: FOR EACH ROW triggers, on partitioend tables, with indexes? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: FOR EACH ROW triggers, on partitioend tables, with indexes?
Date
Msg-id 20220901085813.jaukr2hyckxm5zkn@alvherre.pgsql
Whole thread Raw
In response to FOR EACH ROW triggers, on partitioend tables, with indexes?  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: FOR EACH ROW triggers, on partitioend tables, with indexes?
List pgsql-hackers
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)



pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Tracking last scan time
Next
From: Alvaro Herrera
Date:
Subject: Re: Solaris "sed" versus pre-v13 plpython tests