From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify SRFs using materialize mode in contrib/ modules
Date: Tue, 08 Mar 2022 01:14:14 +0000
Message-ID: <E1nROQY-001PO0-2s@gemulon.postgresql.org> (raw)
Simplify SRFs using materialize mode in contrib/ modules
9e98583 introduced a helper to centralize building their needed state
(tuplestore, tuple descriptors, etc.), checking for any errors. This
commit updates all places of contrib/ that can be switched to use
SetSingleFuncCall() as a drop-in replacement, resulting in the removal
of a lot of boilerplate code in all the modules updated by this commit.
Per analysis, some places remain as they are:
- pg_logdir_ls() in adminpack/ uses historically TYPEFUNC_RECORD as
return type, and I suspect that changing it may cause issues at run-time
with some of its past versions, down to 1.0.
- dblink/ uses a wrapper function doing exactly the work of
SetSingleFuncCall(). Here the switch should be possible, but rather
invasive so it does not seem the extra backpatch maintenance cost.
- tablefunc/, similarly, uses multiple helper functions with portions of
SetSingleFuncCall() spread across the code paths of this module.
Author: Melanie Plageman
Discussion: https://postgr.es/m/CAAKRu_bvDPJoL9mH6eYwvBpPtTGQwbDzfJbCM-OjkSZDu5yTPg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5b81703787bfc1e6072c8e37125eba0c5598b807
Modified Files
--------------
contrib/amcheck/verify_heapam.c | 46 ++--------------
contrib/dblink/dblink.c | 26 +--------
contrib/pageinspect/brinfuncs.c | 31 ++---------
contrib/pageinspect/gistfuncs.c | 60 ++-------------------
contrib/pg_stat_statements/pg_stat_statements.c | 33 ++----------
contrib/pgrowlocks/pgrowlocks.c | 34 ++----------
contrib/postgres_fdw/connection.c | 31 +----------
contrib/xml2/xpath.c | 72 ++++---------------------
8 files changed, 32 insertions(+), 301 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Simplify SRFs using materialize mode in contrib/ modules
In-Reply-To: <E1nROQY-001PO0-2s@gemulon.postgresql.org>
References: <E1nROQY-001PO0-2s@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