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.96) (envelope-from ) id 1vRLa0-00BSMp-3C for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 02:29:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRLZz-006ClX-2S for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 02:29:56 +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.96) (envelope-from ) id 1vRLZz-006ClP-1X for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 02:29:55 +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 1vRLZx-003Cid-12 for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 02:29:54 +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 5B52TonI1353180; Thu, 4 Dec 2025 21:29:50 -0500 From: Tom Lane To: Michael Paquier cc: Corey Huinker , jian he , Tomas Vondra , pgsql-hackers@lists.postgresql.org Subject: Re: Extended Statistics set/restore/clear functions. In-reply-to: References: <1341064.1764895052@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Fri, 05 Dec 2025 10:19:27 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1353178.1764901790.1@sss.pgh.pa.us> Date: Thu, 04 Dec 2025 21:29:50 -0500 Message-ID: <1353179.1764901790@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Thu, Dec 04, 2025 at 07:37:32PM -0500, Tom Lane wrote: >> This of course arises because the source code is passing the address >> of a local ErrorSaveContext variable to that macro. We don't have >> any other instances of that coding pattern AFAICS, so I wonder if >> that was really the most adapted way to do it. > Thanks for the report. Right. There are three instances of that in > pg_dependencies.c, two in pg_ndistinct.c. I would not mind doing the > attached to calm down these warnings, matching with the other areas of > the code, that simply removes the macro and checks the state value > directly. Ah, right, now that you mention it, 56b1e88c8 did this same fix before. This way is fine with me. I didn't review the error message changes closely. I do wonder if some of them are can't-happen cases that could just use an elog() instead of a translatable message. regards, tom lane