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 1nSUuD-0001of-FR for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Mar 2022 02:21:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSUuB-00067J-Nd for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Mar 2022 02:21:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSUuB-00067A-FY for pgsql-bugs@lists.postgresql.org; Fri, 11 Mar 2022 02:21:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSUu9-00006w-1o for pgsql-bugs@lists.postgresql.org; Fri, 11 Mar 2022 02:21:23 +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 22B2LDT6763987; Thu, 10 Mar 2022 21:21:13 -0500 From: Tom Lane To: Andres Freund cc: Peter Geoghegan , hubert depesz lubaczewski , PostgreSQL mailing lists Subject: Re: Pg 15 devel crashes when fetching data from table using cursor In-reply-to: <20220311021047.hgtqkrl6n52srvdu@alap3.anarazel.de> References: <20220307094423.GA24798@depesz.com> <20220311005045.vnwb3aa5htilh3rh@alap3.anarazel.de> <20220311015030.irviiohj4e6rvdr5@alap3.anarazel.de> <762946.1646964337@sss.pgh.pa.us> <20220311021047.hgtqkrl6n52srvdu@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 10 Mar 2022 18:10:47 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <763985.1646965273.1@sss.pgh.pa.us> Date: Thu, 10 Mar 2022 21:21:13 -0500 Message-ID: <763986.1646965273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > I think we basically have to move the setting of PROC_IN_VACUUM to the last > moment, when we've done everything else, and then force a new snapshot to be > computed after. Maybe we can add Assert(!PROC_IN_VACUUM) to catalog accesses? But the main reason I'm concerned about this is that I fear people will unthinkingly put catalog accesses into error paths, where they might well not get exercised by any normal testing. The poster child for this is something like if (unlikely-condition) elog(ERROR, "Houston, we have a problem with table %s", get_rel_name(relid)); Assertions are unlikely to help us catch that. regards, tom lane