Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEphQ-004Scp-0d for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 14:34:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEphO-003GS3-0V for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 14:34:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEphN-003GRv-2o for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 14:34:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wEphL-00000001w6k-2lB1 for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 14:34:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 63KEXsvx260138; Mon, 20 Apr 2026 10:33:54 -0400 From: Tom Lane To: Paul A Jungwirth cc: Peter Eisentraut , Chao Li , PostgreSQL Hackers Subject: Re: SQL:2011 Application Time Update & Delete In-reply-to: References: <85ac7f0e-d95f-4377-ade0-8941fd328012@eisentraut.org> <7d63ddfa-c735-4dfe-8c7a-4f1e2a621058@eisentraut.org> <4606deaa-7d65-4f22-8a78-356c3180be9d@eisentraut.org> <53f1c094-3c29-4ef6-a9bd-dc2e7894ceb0@eisentraut.org> <4126231.1776622202@sss.pgh.pa.us> Comments: In-reply-to Paul A Jungwirth message dated "Sun, 19 Apr 2026 11:51:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <260136.1776695634.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 20 Apr 2026 10:33:54 -0400 Message-ID: <260137.1776695634@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Paul A Jungwirth writes: > On Sun, Apr 19, 2026 at 11:10 AM Tom Lane 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