Re: pg_restore schema dump to schema with different name

From: Jean-Christophe Boggio <postgresql(at)thefreecat(dot)org>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore schema dump to schema with different name
Date: 2021-08-23 13:38:44
Message-ID: f3d480e2-dbda-83f2-ebbe-2b97e5525e3e@thefreecat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> The only way to do that is to create a new database, import the data
> there, rename the schema and dump again.
>
> Then import that dump into the target database.

Or maybe (if you can afford to have source_schema unavailable for some
time) :

* rename source_schema to tmp_source
* import (that will re-create source_schema)
* rename source_schema to destination_schema
* rename back tmp_source to source_schema

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Nagaraj Raj 2021-08-23 17:54:33 Re: pg_restore schema dump to schema with different name
Previous Message Laurenz Albe 2021-08-23 13:19:26 Re: pg_restore schema dump to schema with different name