On Wed, 2025-02-26 at 04:25 -0500, Corey Huinker wrote:
> 0001 - Add attnum support to attribute_statistics_update
>
> * Basically what Tom posted earlier, minus the pg_set_attribute_stats
> stuff, obviously.
Should have a couple simple tests.
And I would use two different error message wordings:
"must specify either attname or attnum"
"cannot specify both attname and attnum"
(or similar)
The "one of attname and attnum" is a bit awkward.
The new struct for pg_clear_attribute_stats() isn't great, but as
discussed we can get rid of that in a subsequent commit.
Otherwise LGTM.
> 0002 - Add attnum support to pg_dump.
>
> * Removed att_stats_arginfo
> * Folds appendRelStatsImport and appendAttStatsImport
> into dumpRelationStats
Can we add a test here, too, to check that tables dump the attname and
indexes dump the attnum?
Everything else in the file uses i_fieldname = PQfnumber(), but in this
patch you're just using raw numbers.
Some of the fields from pg_stats are NOT NULL, so we could consider
issuing a warning in that case rather than just skipping it.
And it could use a pgindent.
I ran a quick measurement and it appears within the noise of the
numbers I posted here:
https://www.postgresql.org/message-id/6af48508a32499a8be3398cafffd29fb6188c44b.camel@j-davis.com
Regards,
Jeff Davis