Attached is v24, incorporating Jeff's feedback - looping an arg data structure rather than individually checking each param type being the biggest of them.
v23's part one has been broken into three patches:
And the two pg_dump-related patches remain unchanged.
I think this split is a net-positive for reviewability. The one drawback is that there's a lot of redundancy in the regression tests now, much of which can go away once we decide what other data problems we don't need to check.