I've been tasked to create a workflow to copy various schemas of a database "db" from a remote cluster to a local cluster.
database: db
consists of
schema a -> should be included in the dump schema b -> should be included in the dump schema c -> not needed schema d -> not needed schema e -> consists of a bunch of foreign tables / data for this tables should *not* be included in dump (only CREATE of the foreign tables is required) schema f -> should be included in the dump
There also exists a foreign server fsrv in the remote database.
The role transfer_role has read access to all tables in schematas a, b and f
What's the trick to use --schema= with pg_dump *AND* also have the foreign server definition and the user mappings copied? (I also included --schema=public but that changed nothing)