Make SPI_prepare argtypes argument const
Peter Eisentraut <peter@eisentraut.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/postgres_fdw.c | modified | +3 −3 |
| doc/src/sgml/spi.sgml | modified | +5 −5 |
| src/backend/executor/spi.c | modified | +17 −11 |
| src/backend/utils/adt/ri_triggers.c | modified | +2 −2 |
| src/backend/utils/cache/plancache.c | modified | +1 −1 |
| src/include/executor/spi.h | modified | +5 −5 |
| src/include/executor/spi_priv.h | modified | +1 −1 |
| src/include/utils/plancache.h | modified | +1 −1 |
Documentation touched
Discussion
- Make SPI_prepare argtypes argument const 6 messages · 2026-06-11 → 2026-06-30