> Something like the attached seems like it'd do the job.
I tried it. I took a pg_dumpall from a 13 cluster after the regression tests, ran 002_pg_upgrade.pl on master with it, and then ran amcheck on the upgraded cluster. Without the patch amcheck complains with the following. With the patch it is clean.
`ERROR: index "ctl_bpchar" metapage incorrectly indicates that deduplication is safe`