Refactor PostgreSQL to use the general `TypeMap` for OIDs

Part of #15134, dependent on #15165. See last commit for correct diff. /cc @senny