Re: Make SPI_prepare argtypes argument const

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make SPI_prepare argtypes argument const
Date: 2026-06-11 18:35:22
Message-ID: c19e7139-f78a-4ece-97c5-dec0efe711c6@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11.06.26 14:56, Tom Lane wrote:
> Peter Eisentraut <peter(at)eisentraut(dot)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?

I don't think we are tracking ABI compatibility in unreleased branches?

One related thing I remember being discussed is adding qualifiers to
functions that are part of the index or table access method APIs,
because that breaks source code compatibility. I don't think that kind
of concern applies here. (Also, I think we could still do those kinds
of changes, but it'd be better to do them all at once in one release.)

> 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.

Those were already done, except that there were two curious stragglers,
which I've added another patch to fix.

Attachment Content-Type Size
v2-0001-Make-SPI_prepare-argtypes-argument-const.patch text/plain 11.8 KB
v2-0002-Add-some-more-const-qualifiers-to-SPI-functions.patch text/plain 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-06-11 18:42:05 Re: Fix missing semicolon in pl_gram.y for option_value rule
Previous Message Salma El-Sayed 2026-06-11 17:25:10 Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions