From: andrew cooke <andrew@acooke.org>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Logical subscription / publication lifetimes
Date: Fri, 22 Apr 2022 12:59:29 -0400
Message-ID: <20220422165929.ziyzyk5ivahr63iy@acooke.org> (raw)
In-Reply-To: <CAKFQuwb3QzPfHsHr48nmst6LwW4Ui9SOWiK1YaNCddidsp50Yg@mail.gmail.com>
References: <20220422120039.rpvohhfllv3s2im7@acooke.org>
<CAKFQuwb3QzPfHsHr48nmst6LwW4Ui9SOWiK1YaNCddidsp50Yg@mail.gmail.com>
Ah, thanks! I should have read the documentation of all the
parameters!
So the portion of data that is covered by "copy_data" is going to
reflect updates and deletes prior to the creation of the slot even if
"publish=insert" (only)?
This makes sense because I can't see how else it could be practically
implemented, but just want to be sure I am understanding. The idea
that there are two phases (copy existing data then replicate
operations) is a big help.
Thanks again,
Andrew
On Fri, Apr 22, 2022 at 09:13:15AM -0700, David G. Johnston wrote:
> On Fri, Apr 22, 2022 at 5:00 AM andrew cooke <andrew@acooke.org> wrote:
>
> >
> > If I define a publication at time Tp, then load some data on the
> > publisher, then start a subscription at time Ts, then load some more
> > data on the publisher, does the subscriber get data from Tp or Ts
> > onwards?
> >
> >
> It depends. By default, neither, the publisher is publishing the entire
> contents of the table and the subscriber will do everything necessary to
> replicate those contents in their entirety.
>
> If you specify copy_data = false I'm not sure what you end up with
> initially or after disable. My guess is the subscription defines the first
> transaction it cares about when it connects to the publisher, defaulting to
> the most recent publisher transaction (all older transactions would be
> handled via copy_data = true) but then so long as the slot remains active
> the publisher will place the data into the slot even while the subscriber
> is not active and the subscriber will receive all of it next time it comes
> online/re-enables.
>
> David J.
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: andrew@acooke.org, david.g.johnston@gmail.com
Subject: Re: Logical subscription / publication lifetimes
In-Reply-To: <20220422165929.ziyzyk5ivahr63iy@acooke.org>
References: <20220422120039.rpvohhfllv3s2im7@acooke.org> <CAKFQuwb3QzPfHsHr48nmst6LwW4Ui9SOWiK1YaNCddidsp50Yg@mail.gmail.com> <20220422165929.ziyzyk5ivahr63iy@acooke.org>
* 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