Re: feature request: pg_restore renaming target schema - Mailing list pgsql-admin

From CN
Subject Re: feature request: pg_restore renaming target schema
Date
Msg-id 1450369108.2740801.470182945.59E4E975@webmail.messagingengine.com
Whole thread Raw
In response to Re: feature request: pg_restore renaming target schema  (John Scalia <jayknowsunix@gmail.com>)
Responses Re: feature request: pg_restore renaming target schema
List pgsql-admin
On Thu, Dec 17, 2015, at 11:34 PM, John Scalia wrote:
Maybe a bit off-postgresql, but why couldn't you just add to your existing automations script, Use sed or your favorite stream editor and have that do the renaming in the dump output?
FWIW,
Jay                          or over the web 
 
I thought this approach before I raised this request. I had peeked the dumped file and had a feeling that manipulating the dumped file with stream editors was infeasible because I thought that the source schema name was scrambled everywhere in the dumped file, data included.
 
Having received your message, I started to think that the approach I gave up in the very beginning might actually be the feasible one - thinking that you would not have mentioned it otherwise!
 
Hence I went back and took a more thorough look at the dumped file and happily to find that it *appears* to me that I only need to edit the first several lines of the dumped file in addition to such lines:
 
ALTER FUNCTION <schema name>.my_function(....) OWNER TO ....
 
With that said, the appearance pattern of source schema name in the dumped file seems to be predictable. I will study more to make sure stream editors can do this job.
 
Many thanks for the hint!
 
Best Regards,
CN
-- 
http://www.fastmail.com - The professional email service

pgsql-admin by date:

Previous
From: John Scalia
Date:
Subject: Re: feature request: pg_restore renaming target schema
Next
From: Michał Nowak
Date:
Subject: Re: semop hanging - Postgres 9.4.4