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 1txTBx-009qf8-N4 for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2025 16:01:21 +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 1txTBv-005kZp-Vk for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2025 16:01:19 +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.94.2) (envelope-from ) id 1txTBv-005kZh-NK for pgsql-bugs@lists.postgresql.org; Wed, 26 Mar 2025 16:01:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1txTBt-001L1s-1L for pgsql-bugs@lists.postgresql.org; Wed, 26 Mar 2025 16:01:19 +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 52QG0xVL1618268; Wed, 26 Mar 2025 12:00:59 -0400 From: Tom Lane To: "Euler Taveira" cc: "Tender Wang" , 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> Comments: In-reply-to "Euler Taveira" message dated "Tue, 25 Mar 2025 22:55:52 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1618266.1743004859.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Mar 2025 12:00:59 -0400 Message-ID: <1618267.1743004859@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Euler Taveira" writes: > Your patch needs some adjustments. There is no need to include pg_class.= h. I > don't like the proposed error message. I prefer saying the relation cann= ot be > opened because that's what will happen if it reaches this code path. I don't care for that proposal either: we just did open the relation ;-) Looking at other places where we throw an error for !RELKIND_HAS_STORAGE: rawpage.c: (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot get raw page from relation \"%s\"", pgstatindex.c: (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot get page count of relation \"%s\"", tid.c: errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot look at latest visible tid for relation \"%= s.%s\"", relcache.c: elog(ERROR, "relation \"%s\" does not have storage", RelationGetRelationName(relation)); So the previous proposal was evidently modeled on the first two of these precedents. Personally I prefer messages that say *why* something failed, so I'd go with something more like "relation \"%s\" does not have storage". Use of errdetail_relkind_not_supported is fine though. regards, tom lane