Re: Using Expanded Objects other than Arrays from plpgsql
Michel Pelletier <pelletier.michel@gmail.com>
From: Michel Pelletier <pelletier.michel@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-12-08T07:05:13Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow extension functions to participate in in-place updates.
- c366d2bdba7c 18.0 landed
-
Implement new optimization rule for updates of expanded variables.
- 6c7251db0ce1 18.0 landed
-
Detect whether plpgsql assignment targets are "local" variables.
- 36fb9ef269a0 18.0 landed
-
Preliminary refactoring of plpgsql expression construction.
- a654af21ae52 18.0 landed
-
Refactor pl_funcs.c to provide a usage-independent tree walker.
- 6a7283dd2f1c 18.0 landed
-
Generalize plpgsql's heuristic for importing expanded objects.
- 534d0ea6c2b9 18.0 landed
On Fri, Dec 6, 2024 at 4:51 PM Michel Pelletier <pelletier.michel@gmail.com> wrote: > > My question is about nvals = nvals(graph) in that function above, the > object is flattened and then rexpanded, even after the object was expanded > and returned by wait() [1] into a r/w pointer. > ... > > mxm calls expand_matrix three times for each of the three arguments. > Ideally I'd like the already expanded rw pointer from wait() to be honored > by mxm so that it doesn't re-expand the object three times but, like > set_element, not at all. > My bad, sorry for the long confusing email, I figured out that I was calling the wrong macro when getting my matrix datum and inadvertently expanding RO pointers as well, I've fixed that issue, and everything is working great! No extra expansions and my support functions are working well, I need to go through a few more places in the API to add more support but otherwise the fixes Tom has put into plpgsql have worked perfectly and the library now appears to be behaving optimally! I can get down to doing some benchmarks and head-to-head with the C and Python bindings to compare against. Thanks for your help Tom, I'm looking forward to the changes being released soon! In the meanwhile I'll keep a locally patched version for ongoing testing purposes. -Michel >