Thanks. I tentatively submitted a patch (See the attachment).
By the way, current pg_upgrade test script depends on the left data on test database, but it seems that
a lot of tables are dropped in those test SQL files so this affects the pg_upgrade test coverage much.
Maybe this needs to be addressed in the future. (Maybe when anyone checks in test cases pg_upgrade
needs to be considered also?)