pgsql: Generalize plpgsql's heuristic for importing expanded objects. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Generalize plpgsql's heuristic for importing expanded objects.
Date
Msg-id E1t41dV-002G3e-AC@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Generalize plpgsql's heuristic for importing expanded objects.

If a R/W expanded-object pointer is passed as a function parameter,
take ownership of the object, regardless of its type.  Previously
this happened only for expanded arrays, but that was a result of
sloppy thinking.  (If the plpgsql function did not end by returning
the object, the result would be to leak the object until the
surrounding memory context is cleaned up.  That's not awful,
since non-expanded values have always been managed that way,
but we can do better.)

Per discussion with Michel Pelletier.  There's a lot more to do
here to make plpgsql work efficiently with expanded objects that
aren't arrays, but this is an easy first step.

Discussion: https://postgr.es/m/CACxu=vJaKFNsYxooSnW1wEgsAO5u_v1XYBacfVJ14wgJV_PYeg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/534d0ea6c2b915ac9745d2f070afacd7ba003d28

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Fix parallel worker tracking of new catalog relfilenumbers.
Next
From: Jeff Davis
Date:
Subject: pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_