Just to show what I'm talking about, here are a few prototype patches.
Beware, these are all very lightly tested/reviewed. Input is welcome,
particularly if it comes in the guise of patches to regression tests
showing cases that misbehave.
0001 is a fixup for the v6 patch I posted upthread; it's needed so the
0002 patch doesn't end up with indexes marked invalid after pg_dump.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services