Re: Copy entire schema A to a different schema B - Mailing list pgsql-general

From Tiffany Thang
Subject Re: Copy entire schema A to a different schema B
Date
Msg-id CAB_W-NNRk9sGF9hZUAZ6HWDyvY_Ch97uQw8og9Ycb-sSrUPe1g@mail.gmail.com
Whole thread Raw
In response to Re: Copy entire schema A to a different schema B  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
Hi Melvin,
Unfortunately I was not able to use it because I was not able to access pg_authid in RDS.

Thanks.

Tiff

On Thu, Feb 21, 2019 at 6:09 PM Melvin Davidson <melvin6925@gmail.com> wrote:
Tiffany, have you tried the clone_schema function? It seems to me it does exactly what you need, no dumping or restoring. There is
even an option to copy the data or not. Default is not.

On Thu, Feb 21, 2019 at 3:23 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 2/21/19 11:52 AM, Tiffany Thang wrote:
> Thanks everyone. Unfortunately the schema rename would not work since
> the source database will be our production system. We have not gone live
> yet but the system is expected to be constantly used.
>
> I have multiple tables that I need to export ranging from 20GB to 60GB
> each. The parallel will not work for a single table but would be
> beneficial if I have multiple tables to dump.
>
> I'm thinking maybe using what Adrian has suggested with the -f option
> and then modify the file or maybe use a common public schema everywhere
> on the source and target databases. I would have to restrict who has
> access to the public schema.

You can further break this down by using -s and -a switches to only work
with the table definitions and table data respectively. This can also be
done on the pg_dump end.

>
> Thanks.
>
> Tiff
>

>      >> --
>      >> Adrian Klaver
>      >> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>


--
Adrian Klaver
adrian.klaver@aklaver.com



--
Melvin Davidson
Maj. Database & Exploration Specialist

Universe Exploration Command – UXC

Employment by invitation only!

pgsql-general by date:

Previous
From: legrand legrand
Date:
Subject: RE: pg_stat_statements doesn't track commit from pl/pgsql blocks
Next
From: Thomas Munro
Date:
Subject: Re: WSL (windows subsystem on linux) users will need to turn fsyncoff as of 11.2