From: CN <cnliou9@fastmail.fm>
To: pgsql-admin@postgresql.org
Subject: Re: feature request: pg_restore renaming target schema
Date: Thu, 17 Dec 2015 23:19:46 +0800
Message-ID: <1450365586.2726209.470114761.326B7E39@webmail.messagingengine.com> (raw)
In-Reply-To: <CAGDYbUNK2tQZz4SfFBZit8o5wqHgy3Hz3SOgVhxkHh3aZ1DOwg@mail.gmail.com>
References: <1450338245.2626908.469822713.6C14EE8F@webmail.messagingengine.com>
<CAGDYbUNK2tQZz4SfFBZit8o5wqHgy3Hz3SOgVhxkHh3aZ1DOwg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Thank you! Venkataramana,
On Thu, Dec 17, 2015, at 09:20 PM, Shreeyansh Dba wrote:
> But if you are trying to do with second option like from source
> schema(s1) of db1 to target schema(t1) of db2, it is not possible with
> pg_restore because while restoring from backup dump, it follows the
> sequence of commands like "CREATE SCHEMA s1" "SET SEARCH_PATH=s1"
> "CREATE TABLE table_name(id int)" "INSERT INTO table_name VALUES(1)"
Indeed. I have just peeked the content of the dumped file in plain
format and have noticed that all objects are prefixed with original
schema name. This makes me feel that the task of adding the mentioned
feature to pg_restore or pg_dump must be nontrivial :-(
> 2: If you are taking the dump in plan text format you can edit the
> plain text file and replace schema old name to new name and then
> you can restore the file using psql -d <db> -U <user> -f <path of
> plain text file>.
>
Manual editing is not quite feasible because I need to automate the
sequence of jobs by executing pg_dump and pg_restore in program.
Best Regards, CN
--
http://www.fastmail.com - Accessible with your email software
or over the web
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: cnliou9@fastmail.fm
Subject: Re: feature request: pg_restore renaming target schema
In-Reply-To: <1450365586.2726209.470114761.326B7E39@webmail.messagingengine.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox