Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llxdU-00072w-Ck for pgsql-bugs@arkaria.postgresql.org; Wed, 26 May 2021 17:48:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1llxdT-0008Jj-7I for pgsql-bugs@arkaria.postgresql.org; Wed, 26 May 2021 17:48:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llxdS-0008Ja-UQ for pgsql-bugs@lists.postgresql.org; Wed, 26 May 2021 17:48:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llxdM-0001U6-M6 for pgsql-bugs@lists.postgresql.org; Wed, 26 May 2021 17:48:01 +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 14QHlrqe1549813; Wed, 26 May 2021 13:47:53 -0400 From: Tom Lane To: Alvaro Herrera cc: rekgrpth@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17035: assert after commit In-reply-to: <20210526174017.GA11909@alvherre.pgsql> References: <20210526174017.GA11909@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 26 May 2021 13:40:17 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1549811.1622051273.1@sss.pgh.pa.us> Date: Wed, 26 May 2021 13:47:53 -0400 Message-ID: <1549812.1622051273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Hmm, see for example [1] which is doing SPI_prepare_my() [2] and then > SPI_execute_plan_my() ... Does the SPI interface really require that you > create an ActivePortal in the SPI-calling code? The expectation is that the calling code is already executing inside some Portal. If it isn't, it's incumbent on the caller to set up an adequate substitute environment, in particular a transaction snapshot. The only thing 84f5c2908 changed is that now you get a guaranteed failure if you neglect to provide that, rather than failing only in corner cases. Possibly we should change that Assert to an elog that tries to make it clear that the blame is on the caller. regards, tom lane