agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make SPI_prepare argtypes argument const
Date: Tue, 30 Jun 2026 13:52:50 +0000
Message-ID: <E1weYtO-000me2-2I@gemulon.postgresql.org> (raw)

Make SPI_prepare argtypes argument const

This changes the argtypes argument of SPI_prepare(),
SPI_prepare_cursor(), SPI_cursor_open_with_args(), and
SPI_execute_with_args() from Oid *argtypes to const Oid *argtypes.
The underlying functions were already receptive to that, so this
doesn't require any significant changes beyond the function signatures
and some internal variables.

Commit 28972b6fc3dc recently introduced a case where a const had to be
cast away before calling these functions.  This is fixed here.

In passing, make a very similar const addition to SPI_modifytuple().

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/86b5162f-c472-40fa-997b-0450dece1dec%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b1c41398e48ca7d38a46c901dc93872c968b227c

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c |  6 +++---
doc/src/sgml/spi.sgml               | 10 +++++-----
src/backend/executor/spi.c          | 28 +++++++++++++++++-----------
src/backend/utils/adt/ri_triggers.c |  4 ++--
src/backend/utils/cache/plancache.c |  2 +-
src/include/executor/spi.h          | 10 +++++-----
src/include/executor/spi_priv.h     |  2 +-
src/include/utils/plancache.h       |  2 +-
8 files changed, 35 insertions(+), 29 deletions(-)



Message-ID: <E1weYtO-000me2-2I@gemulon.postgresql.org>
Permalink:  ../E1weYtO-000me2-2I@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1weYtO-000me2-2I@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: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make SPI_prepare argtypes argument const
  In-Reply-To: <E1weYtO-000me2-2I@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox