pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Generalize plpgsql's heuristic for importing expanded objects.
Date: Thu, 24 Oct 2024 17:28:36 +0000
Message-ID: <E1t41dV-002G3e-AC@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1t41dV-002G3e-AC@gemulon.postgresql.org>
Permalink:  ../E1t41dV-002G3e-AC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t41dV-002G3e-AC@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Generalize plpgsql's heuristic for importing expanded objects.
  In-Reply-To: <E1t41dV-002G3e-AC@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox