pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Akheel Ahmed <akheel.mailing.list@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: create all indexes and triggers in a schema after bulk load
Date: Wed, 17 Nov 2021 08:16:44 +0100
Message-ID: <20211117071643.GA11260@depesz.com> (raw)
In-Reply-To: <06fbb436-d81b-4428-029c-91e6f1181ed5@gmail.com>
References: <06fbb436-d81b-4428-029c-91e6f1181ed5@gmail.com>

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





view thread (3+ messages)  latest in thread

Message-ID: <20211117071643.GA11260@depesz.com>
Permalink:  ../20211117071643.GA11260@depesz.com/
Also on:    postgresql.org/message-id/20211117071643.GA11260@depesz.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, akheel.mailing.list@gmail.com
  Subject: Re: create all indexes and triggers in a schema after bulk load
  In-Reply-To: <20211117071643.GA11260@depesz.com>
  References: <06fbb436-d81b-4428-029c-91e6f1181ed5@gmail.com> <20211117071643.GA11260@depesz.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