Thanks. I don't think v6 conflicts with Tom's idea. Banning NaN would reject input that works today, so it can't be back-patched. And in master, NaN boxes already on disk stay there after pg_upgrade. So the indexes need fixing either way.
If you want less code, I can drop 0004 and use the v6-REL_18-0001 check on master too. That leaves no catalog change.