Re: [HACKERS] plpgsql, caching, resowners and jit - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] plpgsql, caching, resowners and jit
Date
Msg-id 806.1495478410@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] plpgsql, caching, resowners and jit  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> After doing so, I got pretty weird crashes.  A bit of debugging later it
> became apparent that the issue is in how plpgsql caches expression
> states: ...
> which means we'll re-use ExprStates built in another subtransaction.

Sure, why not?  They generally aren't going to change across
subtransactions.

I do not recall that there's a separate resowner for those things
though.  Usually the idea for ExprState-related resources is to
clean them up in an ExprContextCallback, cf executor/functions.c.
Might work better if you attack it that way instead of via a resowner.

Or maybe we could set up a separate resowner for plpgsql's simple
expression states.  Not sure what consequences that would have,
but it doesn't seem unreasonable on its face.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeremy Finzel
Date:
Subject: [HACKERS] Is it possible to get query_string value in an event trigger?
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] psql - add special variable to reflect the last query status