I also attached a patch implementing a different approach to the
pg_dump support. Instead of trying to create a query that uses SQL
"format()" to create more SQL, I did all the formatting in C. It turned
out to be about 30% fewer lines, and I find it more understandable and
consistent with the way other stuff in pg_dump happens.
That is fairly close to what I came up with per our conversation (attached below), but I really like the att_stats_arginfo construct and I definitely want to adopt that and expand it to a third dimension that flags the fields that cannot be null. I will incorporate that into v15.
As for v14, here are the highlights:
0001:
- broke up pg_set_attribute_stats() into many functions. Every stat kind gets its own validation function. Type derivation is now done in its own function.
- removed check on inherited stats flag that required the table be partitioned. that was in error
- added check for most_common_values to be unique in ascending order, and tests to match
- no more mention of pg_dump in the function documentation
- function documentation cites pg-stats-view as reference for the parameter's data requirements
0002:
- All relstats and attrstats calls are now their own statement instead of a compound statement
- moved the archive TOC entry from post-data back to SECTION_NONE (as it was modeled on object COMMENTs), which seems to work better.
- remove meta-query in favor of more conventional query building
- removed all changes to fe_utils/