Re: Make SPI_prepare argtypes argument const

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-11T12:56:50Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> 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.

We've discussed that before, and held off because we weren't entirely
sure if anyone would complain that it is an API/ABI break.  I think
it's quite likely that the libabigail buildfarm machines will say
it is, but is there any actual consequence?

Also, if we are going to use const in SPI, there are more parameters
besides the datatype OIDs that could stand to be const-ified, eg
the various Datum/isnull arrays.

			regards, tom lane



Commits

  1. Make SPI_prepare argtypes argument const

  2. Fixes for SPI "const Datum *" use

  3. Add support for importing statistics from remote servers.