pg_dump is oblivious to this kind of dependency, so they're lost on dump/restores (and pg_upgrade). Have pg_dump emit ALTER lines so that they're preserved. Add some pg_dump tests for the whole thing, also.
b08dee24a5 Add pg_dump support for ALTER obj DEPENDS ON EXTENSION
src/bin/pg_dump/common.c | 1 +
src/bin/pg_dump/pg_dump.c | 107 +++++++++++++++++++++++++---
src/bin/pg_dump/pg_dump.h | 1 +
src/test/modules/test_pg_dump/t/001_base.pl | 32 +++++++++
4 files changed, 133 insertions(+), 8 deletions(-)