| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Andres Freund <andres(at)anarazel(dot)de> | 
| Cc: | pgsql-hackers(at)postgresql(dot)org | 
| Subject: | Re: plpgsql, caching, resowners and jit | 
| Date: | 2017-05-22 18:40:10 | 
| Message-ID: | 806.1495478410@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Andres Freund <andres(at)anarazel(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Stehule | 2017-05-22 19:18:54 | Re: psql - add special variable to reflect the last query status | 
| Previous Message | Jeremy Finzel | 2017-05-22 18:18:08 | Is it possible to get query_string value in an event trigger? |