How to Downgrade Postgresql from 11 to 9 to fix "pg_dump: aborting because of server version mismatch" error

Gitlab Omnibus ships with Postgres 9.6. Unfortunately for me, several online references suggest using an external Postgres database container when using the Docker-based release of Gitlab but fail to mention the extremely important requirement: Gitlab only supports the same version of Postgres externally as internally. This fact is buried in the install requirements document, but even there it specifies “9.6 or newer,” but in the case of Docker installs, it should say “9.6 exactly.”