pg_dump: Refactor getIndexes()
pg_dump: Refactor getIndexes()

Rearrange the version-dependent pieces in the new more modular style.

Discussion: https://www.postgresql.org/message-id/flat/67a28a3f-7b79-a5a9-fcc7-947b170e66f0%40enterprisedb.com
(cherry-picked from e2c52beecdea152ca680a22ef35c6a7da55aa30f)

50wu/gpdb,greenplum-db/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,lisakowen/gpdb