Re: pg_restore schema dump to schema with different name

From: Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>
To: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>, Jean-Christophe Boggio <postgresql(at)thefreecat(dot)org>
Subject: Re: pg_restore schema dump to schema with different name
Date: 2021-08-23 17:54:33
Message-ID: 543515895.715906.1629741273076@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Wouldn’t be easy if we have option to_schema ? 
Absolutely, I should not alter current schema, as it live 24/7.
Thanks,Rj On Monday, August 23, 2021, 06:39:03 AM PDT, Jean-Christophe Boggio <postgresql(at)thefreecat(dot)org> wrote:


> 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 Matt Dupree 2021-08-24 00:53:15 Re: Postgres using the wrong index index
Previous Message Jean-Christophe Boggio 2021-08-23 13:38:44 Re: pg_restore schema dump to schema with different name