Jeff indicated that this was more of a stylistic/clarity reworking. I'll be handling it again for now.
+extern Datum pg_set_relation_stats(PG_FUNCTION_ARGS); +extern Datum pg_set_attribute_stats(PG_FUNCTION_ARGS); is unnecessary?
They're autogenerated from pg_proc.dat. I was (pleasantly) surprised too.
this part elevel should always be ERROR? if so, we can just
I'm personally dis-inclined to error on any of these things, so I'll be leaving it as is. I suspect that the proper balance lies between all-ERROR and all-WARNING, but time will tell which.
relation_statistics_update and other functions may need to check relkind? since relpages, reltuples, relallvisible not meaning to all of relkind?
I'm not able to understand either of your questions, can you elaborate on them?