if (dependency->nattributes <= 1) elog(ERROR, "invalid zero-length nattributes array in MVDependencies"); This is an unlikely-to-happen error message, but still, “nattributes” seems confusing?
Agreed the error message should be changed if it's kept at all. That error may never occur now that we test for empty arrays in the array close event handler. So maybe this becomes a plain assert().
similarly, in doc/src/sgml/perform.sgml, I think the query should be:
SELECT stxkeys AS k, jsonb_pretty(stxdndistinct::text::jsonb) AS nd FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid) WHERE stxname = 'stts2' \gx
The example almost certainly predates \gx, so that's a good suggestion.