Re: Extended Statistics set/restore/clear functions.

Corey Huinker <corey.huinker@gmail.com>

From: Corey Huinker <corey.huinker@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Tomas Vondra <tomas@vondra.me>, pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us
Date: 2025-11-22T08:26:19Z
Lists: pgsql-hackers

Attachments

>
>
> wondering, should we check the value of "degree" is between 0 to 1?
>

I'm open to it, but there was significant pushback to having tight validity
checks on other stats types.

The more things that we make errors, the more chances we have to breaking a
dump/restore. Granted, such values should never happen, but odd things do
happen.


>
> IF the value of ""dependency"
> does not meet
> ``(if (parse->dependency == 0 || parse->dependency <
> (0-STATS_MAX_DIMENSIONS))``
> then error out.
> see the attached patch.
>

Good catch.

Incorporated these patches as well as Yuefei's feedback especially around
memory management.

I added a comment debating the feasibility of testing for subsets of
attribute sets in pg_dependencies. Basically, I think we can't have the
test at all, but I haven't removed it just yet pending consensus.