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 1txG0y-005Zul-3Q for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2025 01:57:08 +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 1txG0w-00DDLO-9J for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2025 01:57:06 +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 1txG0v-00DDL8-El for pgsql-bugs@lists.postgresql.org; Wed, 26 Mar 2025 01:57:06 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1txG0q-001Brz-2m for pgsql-bugs@lists.postgresql.org; Wed, 26 Mar 2025 01:57:04 +0000 Received: from phl-compute-13.internal (phl-compute-13.phl.internal [10.202.2.53]) by mailfhigh.stl.internal (Postfix) with ESMTP id 22927254011D; Tue, 25 Mar 2025 21:56:58 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-13.internal (MEProxy); Tue, 25 Mar 2025 21:56:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1742954217; x=1743040617; bh=7DWsQTgpnW DKG8cWFWvWhLNIl6SrsyBm49ZRZzxt+wY=; b=hU/adJ/0s7+gypqT/+zc42CoXY UfSjgt4NG2haJgUUNjiDVD88qW2vrwBu75UI/8G/s/QQrGtlERrB+X48ARVBHmRb 36S9adzFP3gMs5Xm6FpkVlQIGQosVyiH/fEMPCwe5fD3mV9QsYPZPRxhpzxB+VoZ /AUSP4g9l8bhd+cPIukDIs39WUzRUTUuB2ENT75/IO2oacBvvpjdX8b/PnAxspEj Nsr37SmRGW0pARUtbIXwarzJpqO5gi6/a9MeycVtUcZMXdGk0usEuAbEiL3VvIie vZPkPXCAYisjoqxrlQ4NZ2zvdng8/9nAOH0Nroa6iTK2yfLJ9aRYgxybGGuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1742954217; x=1743040617; bh=7DWsQTgpnWDKG8cWFWvWhLNIl6SrsyBm49Z RZzxt+wY=; b=aiTcKg8F9kzVACBBgoXb8xvsyJGF/1t5dw0l7Ev8uMgxCh73biW uwOxmDrfbqaGZBGIgklZk7Rj8oGEAR8HifW1VBqRPiKsurMjTk0VxxLHI4FN2vEZ aDui7hMTSibsral5nLqoifiRQaYM02ej2p2wSRPes/epTickmmY1H7VXwvel2krx C5iXFq/z8bpuJY2kTzjqj3R+jMIXK+V3fPYNDTgBfgsvAITEK0EUtXQRL5P20GiM ajO/uz03EKIlvxi4Ln7ukY2GpaCFNrAkGDoybeZ7ZAz5icNLHDENoflJ7+cqVrDs PKObPMKyVE6sOintZob9Ct6QtvjSKOtgf9A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieegvdejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgesmhdtreerredt tdenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvg hrthhordgtohhmqeenucggtffrrghtthgvrhhnpeeffeegkefhledvleffkefhtdeiheei iedvueeihefghfeigeekjefhvefgleefheenucffohhmrghinhepvghnthgvrhhprhhish gvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohephedpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepthhhrghrrghkrghnsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepthhnughrfigrnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoh ephhhlihhnnhgrkhgrsehikhhirdhfihdprhgtphhtthhopehpghhsqhhlqdgsuhhgshes lhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepthhglhesshhssh drphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A895F780068; Tue, 25 Mar 2025 21:56:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T19f6e68f6dea2943 Date: Tue, 25 Mar 2025 22:55:52 -0300 From: "Euler Taveira" To: "Tender Wang" , "Tom Lane" Cc: tharakan@gmail.com, pgsql-bugs@lists.postgresql.org, "Heikki Linnakangas" Message-Id: In-Reply-To: References: <18866-d68926d0f1c72d44@postgresql.org> <1280897.1742920635@sss.pgh.pa.us> Subject: Re: BUG #18866: Running pg_freespace() on views triggers an Abort Content-Type: multipart/mixed; boundary=25839b2278254617b9e4f9efbb1a2cc8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --25839b2278254617b9e4f9efbb1a2cc8 Content-Type: multipart/alternative; boundary=78440ae4a5ad4496887ebd8745de79a3 --78440ae4a5ad4496887ebd8745de79a3 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, Mar 25, 2025, at 10:18 PM, Tender Wang wrote: > Thanks for the advice. Please see the attached patch. 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 cannot be opened because that's what will happen if it reaches this code path. This is an existing message so no need for translation. The output will be like: postgres=# SELECT pg_freespace('f', 0); ERROR: cannot open relation "f" DETAIL: This operation is not supported for foreign tables. postgres=# SELECT pg_freespace('pg_roles', 0); ERROR: cannot open relation "pg_roles" DETAIL: This operation is not supported for views. postgres=# SELECT pg_freespace('pg_class', 0); pg_freespace -------------- 7520 (1 row) I'm attaching a patch that includes these modifications. -- Euler Taveira EDB https://www.enterprisedb.com/ --78440ae4a5ad4496887ebd8745de79a3 Content-Type: text/html Content-Transfer-Encoding: quoted-printable