Re: pg_restore remap schema

Marcos Pegoraro <marcos@f10.com.br>

From: Marcos Pegoraro <marcos@f10.com.br>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Guillaume Lelarge <guillaume@lelarge.info>, Fabrice Chapuis <fabrice636861@gmail.com>, "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2022-08-08T19:26:36Z
Lists: pgsql-general
>
> People have asked for such a thing before, but it'd be quite difficult
> to do reliably --- particularly inside function bodies, which aren't
> normally parsed at all during a dump/restore.  If you're willing to
> accept a 95% solution, running the pg_restore output through "sed"
> would likely work fairly well.  I'd personally want to diff the
> before-and-after scripts before applying though :-)
>

Another 95% solution, if both schemas are on the same server, google for
function clone schema, you´ll find some of them. They create tables,
functions, sequences, views, ...