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.94.2) (envelope-from ) id 1txpfc-00FIwN-EC for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Mar 2025 16:01:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1txpfa-008zc9-6G for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Mar 2025 16:01:26 +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.94.2) (envelope-from ) id 1txpfZ-008zbe-Tc for pgsql-bugs@lists.postgresql.org; Thu, 27 Mar 2025 16:01:25 +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.96) (envelope-from ) id 1txpfY-001SKA-02 for pgsql-bugs@lists.postgresql.org; Thu, 27 Mar 2025 16:01:25 +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 52RG1DZE2052348; Thu, 27 Mar 2025 12:01:13 -0400 From: Tom Lane To: Richard Guo cc: Tender Wang , Euler Taveira , tharakan@gmail.com, pgsql-bugs@lists.postgresql.org, Heikki Linnakangas Subject: Re: BUG #18866: Running pg_freespace() on views triggers an Abort In-reply-to: References: <18866-d68926d0f1c72d44@postgresql.org> <1280897.1742920635@sss.pgh.pa.us> <1618267.1743004859@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Thu, 27 Mar 2025 17:48:22 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2052346.1743091273.1@sss.pgh.pa.us> Date: Thu, 27 Mar 2025 12:01:13 -0400 Message-ID: <2052347.1743091273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Not related to this issue but I wonder why blkno is verified after > the relation is opened. It can be verified beforehand, no? It makes sense to me to check the parameters left-to-right, so I think verifying blkno after relation is fine. It's not like there's value in optimizing the failure case. This does, however, suggest that we ought to check the relkind immediately after opening the rel, before the blkno check. I'll adjust the patch that way and push. regards, tom lane