pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CN <cnliou9@fastmail.fm>
To: pgsql-admin@postgresql.org
Subject: Re: feature request: pg_restore renaming target schema
Date: Fri, 18 Dec 2015 00:18:28 +0800
Message-ID: <1450369108.2740801.470182945.59E4E975@webmail.messagingengine.com> (raw)
In-Reply-To: <CABzCKRCYkP400=0ZqOKPsYEb7twKjX8fcQ96hFMGf+6ZsGys=A@mail.gmail.com>
References: <1450338245.2626908.469822713.6C14EE8F@webmail.messagingengine.com>
	<CAGDYbUNK2tQZz4SfFBZit8o5wqHgy3Hz3SOgVhxkHh3aZ1DOwg@mail.gmail.com>
	<1450365586.2726209.470114761.326B7E39@webmail.messagingengine.com>
	<CABzCKRCYkP400=0ZqOKPsYEb7twKjX8fcQ96hFMGf+6ZsGys=A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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

view thread (6+ messages)  latest in thread

Message-ID: <1450369108.2740801.470182945.59E4E975@webmail.messagingengine.com>
Permalink:  ../1450369108.2740801.470182945.59E4E975@webmail.messagingengine.com/
Also on:    postgresql.org/message-id/1450369108.2740801.470182945.59E4E975@webmail.messagingengine.com

 · 

reply

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: <1450369108.2740801.470182945.59E4E975@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