Re: SQL:2011 Application Time Update & Delete

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: SQL:2011 Application Time Update & Delete
Date: 2026-04-20 14:33:54
Message-ID: 260137.1776695634@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> On Sun, Apr 19, 2026 at 11:10 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I notice that execSRF.c also runs pgstat_init_function_usage and
>> pgstat_end_function_usage around each call. That's not too important
>> right now, but I wonder whether we should add it while we're looking
>> at this. It would perhaps be important once we support user-defined
>> withoutPortionProcs.

> I agree we should do that. Here is a patch with that added to your changes.

Pushed, thanks.

> I was curious why execSRF.c uses `rsinfo.isDone != ExprMultipleResult`
> for the finalize parameter, because I don't think a SRF should ever
> return ExprSingleResult, right? So I guess it is just to be cautious.
> Makes sense. I followed that approach.

It's been awhile, but I think these specs were set with the intention
that if a plain function were somehow called as a SRF, it would act as
though it were a SRF returning one row. We haven't quite reached that
with this patch --- I think it'd be an infinite loop as
ExecForPortionOfLeftovers() stands. I'm content with the way things
are though, given that it should always be the case that special
privileges are needed to mark a function as being a
withoutPortionProcs function.

But speaking of infinite loops, should this one contain a
CHECK_FOR_INTERRUPTS call? It's hard to conceive of a case where
the value would be broken down finely enough for that to be a
problem, but ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-04-20 14:34:54 Re: [PATCH] Reject ENCODING option for COPY TO FORMAT JSON
Previous Message Nisha Moond 2026-04-20 14:01:41 Re: Proposal: Conflict log history table for Logical Replication