Re: Memory contexts reset for trigger invocations

2019-02-05 Thread Andres Freund
Hi, On February 5, 2019 7:55:28 PM GMT+05:30, Tom Lane wrote: >Andres Freund writes: >> Wouldn't it be better to reset an appropriate context after each >> invocation? Yes, that'd require some care to manage the lifetime of >> tuples returned by triggers, but that seems OK? > >I'm not sure that

Re: Memory contexts reset for trigger invocations

2019-02-05 Thread Tom Lane
Andres Freund writes: > Wouldn't it be better to reset an appropriate context after each > invocation? Yes, that'd require some care to manage the lifetime of > tuples returned by triggers, but that seems OK? I'm not sure that we can change much here without effectively breaking the trigger-funct

Re: Memory contexts reset for trigger invocations

2019-02-04 Thread Haribabu Kommi
On Tue, Feb 5, 2019 at 4:29 PM Andres Freund wrote: > Hi, > > trigger.c goes through some trouble to free the tuples returned by > trigger functions. There's plenty codepaths that look roughly like: > if (oldtuple != newtuple && oldtuple != slottuple) > hea

Memory contexts reset for trigger invocations

2019-02-04 Thread Andres Freund
Hi, trigger.c goes through some trouble to free the tuples returned by trigger functions. There's plenty codepaths that look roughly like: if (oldtuple != newtuple && oldtuple != slottuple) heap_freetuple(oldtuple); if (newtuple == NULL)