Re: Extended Statistics set/restore/clear functions. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extended Statistics set/restore/clear functions.
Date
Msg-id 1353179.1764901790@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extended Statistics set/restore/clear functions.  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Extended Statistics set/restore/clear functions.
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> 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



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Fix out-of-date comment on makeRangeConstructors
Next
From: Michael Paquier
Date:
Subject: Re: Extended Statistics set/restore/clear functions.