Re: use of SPI by postgresImportForeignStatistics - Mailing list pgsql-hackers

From Robert Haas
Subject Re: use of SPI by postgresImportForeignStatistics
Date
Msg-id CA+TgmoaVcgZJpwxyi7HEfNMJhmm7BXkTQ468jvxkW2QzQZRkvg@mail.gmail.com
Whole thread
In response to Re: use of SPI by postgresImportForeignStatistics  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: use of SPI by postgresImportForeignStatistics
List pgsql-hackers
On Tue, Jun 16, 2026 at 3:11 PM Corey Huinker <corey.huinker@gmail.com> wrote:
> Obviously, even that wouldn't get us to the no-FunctionCallInfo-at-all goal, but it would get us out of the SPI
situation.If we did have a non-fcinfo function API, that API would either have to pass char *params almost exclusively,
orelse each caller would have to do the translation or float-array strings to double[] and such, which would be a lot
ofwork for the caller. 
>
> Would you be ok with a function like attribute_statistics_update, but purely with cstring args? Obviously the callers
wouldhave to modify their calls each time a new stat param is added, but that is seemingly preferable for you than the
currentsituation. 

I feel pretty strongly that we want a way to identify the relation by
OID rather than by schema and name. I'm not sure whether attributes
should be identified by name or by number in this context. Apart from
those things, if passing strings and leaving it up to the called
function to interpret them makes most sense, that's OK with me.

I agree with you that getting rid of SPI is a much higher priority
than getting rid of the FunctionCallInfo stuff altogether. I could
live with DirectFunctionCall if we don't have a better option. I'm a
bit suspicious that this will lead to code bloat in postgres_fdw or
elsewhere, but maybe not.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix segmentation fault and infinite loop in jsonb_{plperl,plpython}
Next
From: surya poondla
Date:
Subject: Re: Improving psql autocompletion for SET LOCAL / SET SESSION