pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
create all indexes and triggers in a schema after bulk load
3+ messages / 2 participants
[nested] [flat]

* create all indexes and triggers in a schema after bulk load
@ 2021-11-17 07:13 Akheel Ahmed <akheel.mailing.list@gmail.com>
  2021-11-17 07:16 ` Re: create all indexes and triggers in a schema after bulk load hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Akheel Ahmed @ 2021-11-17 07:13 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi Group

I am looking at doing a CDC-based upgrade using the following steps:


1. pg_dump schema on source, but exclude indexes and triggers

2. recreate schema on target

3. Do a full load from source to target

4. Recreate all the indexes and triggers on the target

The migration will automatically switch from full load to CDC when all 
tables are fully loaded.

Is there a way to just recreate all indexes and triggers using a 
separate pg_dump on source to capture the ddl and then run it on the target?

Please advise

Thanks

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: create all indexes and triggers in a schema after bulk load
  2021-11-17 07:13 create all indexes and triggers in a schema after bulk load Akheel Ahmed <akheel.mailing.list@gmail.com>
@ 2021-11-17 07:16 ` hubert depesz lubaczewski <depesz@depesz.com>
  2021-11-17 07:18   ` Re: create all indexes and triggers in a schema after bulk load Akheel Ahmed <akheel.mailing.list@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: hubert depesz lubaczewski @ 2021-11-17 07:16 UTC (permalink / raw)
  To: Akheel Ahmed <akheel.mailing.list@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

On Wed, Nov 17, 2021 at 05:13:35PM +1000, Akheel Ahmed wrote:
> Hi Group
> 
> I am looking at doing a CDC-based upgrade using the following steps:
> 
> 
> 1. pg_dump schema on source, but exclude indexes and triggers
> 
> 2. recreate schema on target
> 
> 3. Do a full load from source to target
> 
> 4. Recreate all the indexes and triggers on the target
> 
> The migration will automatically switch from full load to CDC when all
> tables are fully loaded.
> 
> Is there a way to just recreate all indexes and triggers using a separate
> pg_dump on source to capture the ddl and then run it on the target?

There is no need for separate pg_dump.

Just dump once, with -Fc, or (better) -Fd, and then use pg_restore
-l/-L.

depesz





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: create all indexes and triggers in a schema after bulk load
  2021-11-17 07:13 create all indexes and triggers in a schema after bulk load Akheel Ahmed <akheel.mailing.list@gmail.com>
  2021-11-17 07:16 ` Re: create all indexes and triggers in a schema after bulk load hubert depesz lubaczewski <depesz@depesz.com>
@ 2021-11-17 07:18   ` Akheel Ahmed <akheel.mailing.list@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Akheel Ahmed @ 2021-11-17 07:18 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: pgsql-general@lists.postgresql.org

thanks. will give it a try

On 17/11/2021 5:16 pm, hubert depesz lubaczewski wrote:
> On Wed, Nov 17, 2021 at 05:13:35PM +1000, Akheel Ahmed wrote:
>> Hi Group
>>
>> I am looking at doing a CDC-based upgrade using the following steps:
>>
>>
>> 1. pg_dump schema on source, but exclude indexes and triggers
>>
>> 2. recreate schema on target
>>
>> 3. Do a full load from source to target
>>
>> 4. Recreate all the indexes and triggers on the target
>>
>> The migration will automatically switch from full load to CDC when all
>> tables are fully loaded.
>>
>> Is there a way to just recreate all indexes and triggers using a separate
>> pg_dump on source to capture the ddl and then run it on the target?
> There is no need for separate pg_dump.
>
> Just dump once, with -Fc, or (better) -Fd, and then use pg_restore
> -l/-L.
>
> depesz

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-11-17 07:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 07:13 create all indexes and triggers in a schema after bulk load Akheel Ahmed <akheel.mailing.list@gmail.com>
2021-11-17 07:16 ` hubert depesz lubaczewski <depesz@depesz.com>
2021-11-17 07:18   ` Akheel Ahmed <akheel.mailing.list@gmail.com>

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