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 1vVv6n-009itm-1y for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:14:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVv6m-00EzOI-1y for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:14:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVv6m-00EzO1-0g for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 17:14:41 +0000 Received: from sm-r-011-dus.org-dns.com ([84.19.1.230]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVv6i-001GbK-2C for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 17:14:40 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id D26CDA365B for ; Wed, 17 Dec 2025 18:14:35 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id C5B9EA366B; Wed, 17 Dec 2025 18:14:35 +0100 (CET) X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,DMARC_PASS,HTML_MESSAGE,KAM_INFOUSMEBIZ,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id 7FDAFA365B for ; Wed, 17 Dec 2025 18:14:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gelassene-pferde.biz; s=default; t=1765991675; bh=GfTfwazkUMnuskB3nbUeHtIKK2PG2xtbsdFdyQ8wYXs=; h=From:To:Subject; b=PgtRntj31wqjEXd7CibAC9z+oRARtScrMhJOiUbUAMX+2lvARjRYlVG2lMqCzGxMa MuAX+DSvNkk2fZ4axT/iBmNFTiJKyD2i8tthxHPm1e/ue7A5LqKQYGdt6irjREjtSN bIzByoCLYfwex+lLYz1nAAzGRNroq0uZivwZvlLA= Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 197.211.185.168) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=dummy.faircode.eu Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Date: Wed, 17 Dec 2025 18:14:33 +0100 (GMT+01:00) From: Thiemo Kellner To: pgsql-general@lists.postgresql.org Message-ID: <8567de96-062f-416a-9d19-f14abfdc925e@gelassene-pferde.biz> In-Reply-To: <287E4DF6-35A2-4062-AEBA-32DB1DE35C5D@leisi.net> References: <287E4DF6-35A2-4062-AEBA-32DB1DE35C5D@leisi.net> Subject: Record last SELECT on a row? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1_219606990.1765991673612" X-Correlation-ID: <8567de96-062f-416a-9d19-f14abfdc925e@gelassene-pferde.biz> X-PPP-Message-ID: <176599167538.1050726.12144841105476714319@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1_219606990.1765991673612 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi I wonder whether a view calling a set returning function would be a viable option. Within the function you execute the actual query twice. Once to merge selected pk into a protocol table and once for the return of the data set. Cheers Thiemo ------=_Part_1_219606990.1765991673612 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi

I wonder whether a view calling a set returning function would be a viable option. Within the function you execute the actual query twice. Once to merge selected pk into a protocol table and once for the return of the data set.

Cheers

Thiemo
------=_Part_1_219606990.1765991673612--