Re: Extended Statistics set/restore/clear functions.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Extended Statistics set/restore/clear functions.
Дата
Msg-id aTIzH-2Spb4H6BNP@paquier.xyz
обсуждение исходный текст
Ответ на Re: Extended Statistics set/restore/clear functions.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Extended Statistics set/restore/clear functions.
Список pgsql-hackers
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.  Looking at the
> code, it seems to be turning around and stuffing a different error
> message into a passed-in ErrorSaveContext, which feels a little
> weird.

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.

> Also, I don't think these errdetail messages meet our style
> guidelines:
>
>    errdetail("Invalid \"%s\" value.", PG_DEPENDENCIES_KEY_ATTRIBUTES));
>
> They're supposed to be complete sentences.

Yeah, I should have been more careful here.  I have spent more time on
all of these, and adjusted all the errdetails for pg_ndistinct.c and
pg_dependencies.c to use full sentences.

I am just grouping everything with the attached.  They'd be better
if handled separately, obviously.  Comments?
--
Michael

Вложения

В списке pgsql-hackers по дате отправления: