It looks like the problem has been introduced by recent changes to dump
more stuff as "constraints". pg_dump is careful to dump indexes before
constraints --- but the latter category now includes not only foreign
key constraints, but unique/primary constraints, and those will all end
up sorted by pg_constraint OID, it looks like. I think that should work
anyway, most of the time, but clearly after an OID wraparound it's
possible for the OID-order heuristic to fail. So we need to tweak
pg_dump to categorize the different kinds of constraints separately.
regards, tom lane