Re: Include sequence relation support in logical replication

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Cary Huang <cary.huang@highgo.ca>
Cc: Craig Ringer <craig@2ndquadrant.com>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-09T00:26:49Z
Lists: pgsql-hackers
Hi,

On 2020-05-08 16:32:38 -0700, Cary Huang wrote:
> I have added more regression test cases to the sequence replication
> patch with emphasis on transactions and rollback per your
> suggestions. I find that when a transaction is aborted with rollback,
> the decoder plugin will not receive the change but the sequence value
> will in fact advance if nextval() or setval() were called.

Right. The sequence advances shouldn't be treated
transactionally. That's already (optionally) done similarly for
messages, so you should be able to copy that code.

Greetings,

Andres Freund



Commits

  1. Add decoding of sequences to built-in replication

  2. Add decoding of sequences to test_decoding

  3. Logical decoding of sequences