pgsql: Logical replication support for TRUNCATE
pgsql: 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 Author: Marco Nenciarini Author: Peter Eisentraut Reviewed-by: Petr Jelinek Reviewed-by: Andres Freund Reviewed-by: Alvaro Herrera Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/039eb6e92f20499ac36cc74f8a5cef7430b706f6 Modified Files -------------- doc/src/sgml/catalogs.sgml | 8 ++ doc/src/sgml/logical-replication.sgml | 13 +-- doc/src/sgml/protocol.sgml | 56 ++++++++++ doc/src/sgml/ref/create_publication.sgml | 10 +- src/backend/catalog/pg_publication.c | 1 + src/backend/commands/publicationcmds.c | 20 +++- src/backend/replication/logical/proto.c | 55 ++++++++++ src/backend/replication/logical/worker.c | 68 ++++++++++++ src/backend/replication/pgoutput/pgoutput.c | 129 +++++++++++++++------- src/backend/utils/cache/relcache.c | 3 +- src/bin/pg_dump/pg_dump.c | 33 ++++-- src/bin/pg_dump/pg_dump.h | 1 + src/bin/pg_dump/t/002_pg_dump.pl | 2 +- src/bin/psql/describe.c | 26 ++++- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_publication.h | 7 +- src/include/replication/logicalproto.h | 4 + src/test/regress/expected/publication.out | 84 +++++++-------- src/test/subscription/t/010_truncate.pl | 161 ++++++++++++++++++++++++++++ 19 files changed, 572 insertions(+), 111 deletions(-)
Re: pgsql: Logical replication support for TRUNCATE
От:
Andres Freund <andres@anarazel.de>
Дата:
Hi, On 2018-04-07 15:43:53 +0000, Peter Eisentraut wrote: > 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 > Author: Marco Nenciarini > Author: Peter Eisentraut > Reviewed-by: Petr Jelinek > Reviewed-by: Andres Freund > Reviewed-by: Alvaro Herrera https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=serinus&dt=2018-04-07%2015%3A46%3A01 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=flaviventris&dt=2018-04-07%2015%3A46%3A01 - Andres
Re: pgsql: Logical replication support for TRUNCATE
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andres Freund writes: > On 2018-04-07 15:43:53 +0000, Peter Eisentraut wrote: >> Logical replication support for TRUNCATE > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=serinus&dt=2018-04-07%2015%3A46%3A01 > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=flaviventris&dt=2018-04-07%2015%3A46%3A01 After half an hour, out of the twelve buildfarm animals that have run subscription-check, we have twelve failures. Was this tested at all? regards, tom lane