Re: SQL:2011 Application Time Update & Delete

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 15:48:31
Message-ID: CA+renyXfWeQ71YYWPAuMvpVNztMtv2rW62fwzo=F_h6g9JjT+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 20, 2026 at 7:33 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> > 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 ...

A rangetype could only loop 0-2 times; a multirange 0-1. So I don't
think we need it. Eventually user-defined types could loop more, but a
design that inserts many records every time you change something seems
like a bad idea. Maybe I would add it anyway just out of caution, but
I suspect it's excessive.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-04-20 16:01:42 Re: Adding REPACK [concurrently]
Previous Message Melanie Plageman 2026-04-20 15:48:09 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)