Re: pg_restore schema dump to schema with different name

2021-08-30 Thread Nagaraj Raj
I agree with that.But, probably its good idea to add this feature as many people are migrating from oracle to postgres. clone/restore schemas to existing cluster for any test cases like sandbox schema, temp schema as live backup schema etc.  Thanks,Rj On Tuesday, August 24, 2021, 07:56:20 A

Re: pg_restore schema dump to schema with different name

2021-08-24 Thread David G. Johnston
On Mon, Aug 23, 2021 at 2:46 AM Nagaraj Raj wrote: > > Currently this is not something can do. this functionality is there in > oracle. > > Is this future considering to add? (it would really help for create any > test schemas without disturbing current schema. ) > > I find this to be not all th

Re: pg_restore schema dump to schema with different name

2021-08-24 Thread Laurenz Albe
On Mon, 2021-08-23 at 17:54 +, Nagaraj Raj wrote: > Wouldn’t be easy if we have option to_schema ? Sure, but it wouldn't be easy to implement that. It would have to be a part of "pg_dump". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_restore schema dump to schema with different name

2021-08-23 Thread Nagaraj Raj
Wouldn’t be easy if we have option to_schema ?  Absolutely, I should not alter current schema, as it live 24/7. Thanks,RjOn Monday, August 23, 2021, 06:39:03 AM PDT, Jean-Christophe Boggio wrote: > The only way to do that is to create a new database, import the data > there, rename th

Re: pg_restore schema dump to schema with different name

2021-08-23 Thread Jean-Christophe Boggio
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 wi

Re: pg_restore schema dump to schema with different name

2021-08-23 Thread Laurenz Albe
On Mon, 2021-08-23 at 09:44 +, Nagaraj Raj wrote: > I know I can alter schema name after restoring but the problem is the name > already exist and I don't want to touch that existing schema. > The dump type is "custom". > > So effectively I want something like. > pg_dump -U postgres --schema

pg_restore schema dump to schema with different name

2021-08-23 Thread Nagaraj Raj
Hi, I know I can alter schema name after restoring but the problem is the name already exist and I don't want to touch that existing schema.The dump type is "custom". So effectively I want something like.pg_dump -U postgres --schema "source_schema" --format "c" --create --file "source_schema.b