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 1wB3GN-000gqg-1N for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 04:14:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wB3GL-0099NR-1q for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 04:14:34 +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 1wB3GL-0099N1-0u for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 04:14:34 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wB3GJ-00000000I7g-3hB6 for pgsql-hackers@postgresql.org; Fri, 10 Apr 2026 04:14:33 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2b2503753efso13782855ad.0 for ; Thu, 09 Apr 2026 21:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775794468; cv=none; d=google.com; s=arc-20240605; b=G83jd5Nf617T90tcArvNNSxzmyPhQJ0jMdyASKyltyw2ZJjWhTQY+vU61ZvdusQzC5 IU8SlQIu1JSjYFNoPeqU3LdPblxuBltr1JNhORD76kfNXroS3TJWTUQk2lPSDqvoOIuu zfy5uGyOcCyScT/gjTRUtB6C8VUZcztxF/Xy3/G4cweKbfB87dHDnHkYMaqnHZyhPcph 9Oyeckz5GlupgaDMZ6Zh14If44z75/YMI251fbs1gQSOWOCJJXscBk7uKhr1e8EOQN+O 5DtgLiN3/K4TpXCd2T4MSQHNz1q/2wmV6JF4/NC+YzqgtGnpPB/My6nM313BHkJMmBnM By5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rBKCOGHUqWRpmtl/boXj5V94/hzhsp27/L1W2RESt10=; fh=RY6vJKIZ4cEKte6PEYZX76FgmHsd8vmgJKEdNu2+BJg=; b=HW0qbGB8YOlzvRyFzA7yRqtk6PbAshFdfGppw6+EtW+AkL2jGrrZ3pNgs1dWdYfWoW tZtjM3gsHsTXYZINYZLueUYEjSNsCq1pVRukWiJO4OWlVjMDH9T34Ewl6caf+zzuRqQG 8uX4fdVYKK20MThsdL39bre6R15MX0wljr23mW9hV44gqBlf4bBo89Jmrr72SIN2fa9f EGRgaXaJWSSfwJWWrSaO1scqcFHntetRnG/NTvcOeWpGmEqO+WVw2qNQIxa8FHmC21Ox iF+g+3IRzqz+WFxH4eLzYgxqQBXHhjG6SjiS2tX8VgbY5iMe7iLY8u6Ja7DtsRkONf6t zMsw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775794468; x=1776399268; darn=postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rBKCOGHUqWRpmtl/boXj5V94/hzhsp27/L1W2RESt10=; b=eeIWzWpdFpdemaSX9EPXqYSvjfiFN+AeO7SJmXhwQbgGPzQmmaFxJs+TIaaUjqOR+H sBPlKYxfUaA6N7U31SzAhOuc6JCUAJQtmhYXDkEDgKFcRLpnU9apReE9F2ld8KRhi5Cz 4br7y2hOnUTxA4As85X94mRAZLufYUoyLhgHeB0Et+bjqEJttFEemv7kNIKS+wERAJhf J9CyefqwWDs/ItumuJT4PM8laVbJPJux8qj9csr23lM/eLI8R67oOohRpzFvMurBF1aX chwld+SBhcQivvBSd78VG1elzoSEKIMJES8hRZcIniIgLHuJCXyt2904X5NSPqnHhVLz ThVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775794468; x=1776399268; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rBKCOGHUqWRpmtl/boXj5V94/hzhsp27/L1W2RESt10=; b=Ql9fesoEhhaOXx+KzQMCVJbF4SY8sHQSKGd8oMuiH3fQzCpBzt8XwusNgI/FCg5wFd 0lKSG4AjppvWRQMBfTGydwjp5LIUhccya9wdoAVseAMJDy59jMunxafZ2CQXn6/6r4ST 4HN3rnp0/n3lUsxTHwEprbZ1IK9dQmCb4nd2M2hMi99zfwhtvu6g4TOm35Rfw5oHxG9w sfShg0CeuVb71Q4u1E+PT2Nhr1EwhkKcE4bxNF2xqHgr1ciOLjPHf4xYPA2TaneG153r VuvWv4JSZiY/J8hwMM93MoLf8gt61tP7CHW0J8ogg7es19QOY4fHZ18om0hl+I4mz4ML zNhQ== X-Forwarded-Encrypted: i=1; AJvYcCXMALpgVeR2bPjwJoMlqWsDH43Emu7Yjwd9fXF7W7NLqOeKBVBn6XI2mOBy/17q7JuWIDs78Dz69JmjVouc@postgresql.org X-Gm-Message-State: AOJu0Yy7B4YIjd5qjJXC8Vl/Yc20Y/WqVuzSAQhUedV2fMXSAzHbcaW2 kCRJfGLH9DpRrnQycL9VH9FgsMJzfUBAffsCVUhgieNqxCB5Cx7ofq/WkXnTZ8V5CqkgvdO/xb/ Iyalg4TyqkcrIEnLHem0Vh9rBxC4DjNo= X-Gm-Gg: AeBDievq5H0O4pgVYGVNJpDhC2H62uDuEzCI6Eb976p8a0rT/j5uZSp3RIOFC3J9BsD 8YUHXQGSQ2UZdaz7fySw8hGJzZ3PQieF3B5k5vB3AltjmjTGXp4WuHVvOInyFdd1UgVDMueuWcL ALZjamaGsqkmlH5hf0tkqrkjtF4PYz/IQQJUAeuSu2Qm3J0sGzTRkST7NoIXVo71ETLFU49Z/BY mOeKcX3SuQQGjWMyFPPHeJgmASiweYiUe2Miw9i8ISveayxwuI70YS3NQI+PqPWkwxXh2rb73a7 XYXr0yMoPqCWC20g+0EsR6k8wtP/nGDeQ8N7bHBl/mtEpZDG8quFkHcotxtcGICt X-Received: by 2002:a17:902:7442:b0:2b2:cfdf:10e3 with SMTP id d9443c01a7336-2b2d5a3be26mr12244685ad.21.1775794468549; Thu, 09 Apr 2026 21:14:28 -0700 (PDT) MIME-Version: 1.0 References: <43b56e3b-80d6-4a45-a313-cb1caa587b22@vondra.me> <1290fac7-8430-4d2c-bfcb-00c65adff5e5@vondra.me> In-Reply-To: From: Amit Langote Date: Fri, 10 Apr 2026 13:14:11 +0900 X-Gm-Features: AQROBzAy9EfPbdDpmUH_lCcV9xgnCEHcVLwerX8wUsV45DrABEIqs7Mi12dI7sw Message-ID: Subject: Re: Eliminating SPI / SQL from some RI triggers - take 3 To: Sandro Santilli , Amit Langote , Tomas Vondra , Junwang Zhao , Pavel Stehule , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Sandro, On Fri, Apr 10, 2026 at 1:02=E2=80=AFAM Sandro Santilli wrote= : > On Thu, Apr 09, 2026 at 08:55:01PM +0900, Amit Langote wrote: > > Hi Sandro, > > > > On Thu, Apr 9, 2026 at 8:07=E2=80=AFPM Sandro Santilli wr= ote: > > > On Mon, Mar 02, 2026 at 01:34:41PM +0100, Tomas Vondra wrote: > > > > > > > > TBH I haven't noticed the memory context issue myself, I only notic= ed > > > > because the builds with index prefetch started crashing. > > > > > > We're getting a crash in PostGIS too, since that commit was merged in= to > > > the master branch, see https://trac.osgeo.org/postgis/ticket/6066 > > > > > > The crash is triggered a C function using SPI. > > > > Evan Montgomery-Recht posted a report of the same issue on this thread > > a couple of days ago. > > I confirm the patch attached in Evan's email [1] fixes the crash for us. > > [1] https://www.postgresql.org/message-id/CAEg7pwcKf01FmDqFAf-Hzu_pYnMYSc= Y_Otid-pe9uw3BJ6gq9g%40mail.gmail.com > > > I have posted a patch to fix the issue, which I will commit tomorrow > > after a bit more testing. > > I also confirm your patch v4-0001-Fix-RI-fast-path-crash-under-nested-C-l= evel-SPI.patch > fixes the crash for us. Thank you ! Thanks for confirming that. > Let me know when it is time to test again against master. I have just pushed 0001 which you'll find in master as 34a3078629. --=20 Thanks, Amit Langote