Logical replication support for TRUNCATE
Peter Eisentraut <peter_e@gmx.net>
Logical replication support for TRUNCATE Update the built-in logical replication system to make use of the previously added logical decoding for TRUNCATE support. Add the required truncate callback to pgoutput and a new logical replication protocol message. Publications get a new attribute to determine whether to replicate truncate actions. When updating a publication via pg_dump from an older version, this is not set, thus preserving the previous behavior. Author: Simon Riggs <simon@2ndquadrant.com> Author: Marco Nenciarini <marco.nenciarini@2ndquadrant.it> Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com> Reviewed-by: Petr Jelinek <petr.jelinek@2ndquadrant.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +8 −0 |
| doc/src/sgml/logical-replication.sgml | modified | +2 −11 |
| doc/src/sgml/protocol.sgml | modified | +56 −0 |
| doc/src/sgml/ref/create_publication.sgml | modified | +5 −5 |
| src/backend/catalog/pg_publication.c | modified | +1 −0 |
| src/backend/commands/publicationcmds.c | modified | +17 −3 |
| src/backend/replication/logical/proto.c | modified | +55 −0 |
| src/backend/replication/logical/worker.c | modified | +68 −0 |
| src/backend/replication/pgoutput/pgoutput.c | modified | +93 −36 |
| src/backend/utils/cache/relcache.c | modified | +2 −1 |
| src/bin/pg_dump/pg_dump.c | modified | +27 −6 |
| src/bin/pg_dump/pg_dump.h | modified | +1 −0 |
| src/bin/pg_dump/t/002_pg_dump.pl | modified | +1 −1 |
| src/bin/psql/describe.c | modified | +22 −4 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_publication.h | modified | +6 −1 |
| src/include/replication/logicalproto.h | modified | +4 −0 |
| src/test/regress/expected/publication.out | modified | +42 −42 |
| src/test/subscription/t/010_truncate.pl | added | +161 −0 |