remapping schema names with pg_restore?

From: "S(dot)Bob" <sbob(at)quadratum-braccas(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: remapping schema names with pg_restore?
Date: 2020-02-25 23:19:38
Message-ID: 2f0ee65d-acbc-4d4a-eea0-63825d024e5d@quadratum-braccas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All;

Is it possible to re-map / rename schemas when doing a schema based
restore from a custom formatted dump file. I have a dump I created like
this:

/*pg_dump  -Fc  --schema=prod_test  prod_db   > prod_db.dmp*/

I want to restore  it into another cluster, into a db named integ_db but
I want the schema in the restored db to be named integ_test instead of
prod_test

Is there a way  to do this at  pg_restore time? without loading into a
schema named prod_test and renaming the schema after the restore?

Thanks in advance

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Venkat jumbo 2020-02-26 01:33:22 Change password
Previous Message Dipanjan Ganguly 2020-02-25 19:53:57 Re: Connections dropping while using Postgres backend DB with Ejabberd