aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-08-02 19:39:03 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-08-02 21:59:46 -0400
commit9f18fa9995628fef752d704d874eeed0bab815e5 (patch)
tree77e65957d3790575fe49ec3384b4393b28fe4fb8 /src/backend/executor/nodeModifyTable.c
parentdb01c90b2f024298b08dca8aed6b43a2347dee0e (diff)
downloadpostgresql-9f18fa9995628fef752d704d874eeed0bab815e5.tar.gz
postgresql-9f18fa9995628fef752d704d874eeed0bab815e5.zip
Reduce leakage during PL/pgSQL function compilation.
format_procedure leaks memory, so run it in a short-lived context not the session-lifespan cache context for the PL/pgSQL function. parse_datatype called the core parser in the function's cache context, thus leaking potentially a lot of storage into that context. We were also being a bit careless with the TypeName structures made in that code path and others. Most of the time we don't need to retain the TypeName, so make sure it is made in the short-lived temp context, and copy it only if we do need to retain it. These are far from the only leaks in PL/pgSQL compilation, but they're the biggest as far as I've seen, and further improvement looks like it'd require delicate and bug-prone surgery. Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions