From fc77351e10feb1d6a66ce8e5168326898a5c4be1 Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Wed, 19 Feb 2014 10:34:12 -0800 Subject: [PATCH 001/154] Initial commit --- LICENSE | 27 +++++++++++++++++++++++++++ README.md | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..f321188bafd4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014, Euler Taveira de Oliveira +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 000000000000..7fe8f0f51768 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +wal2json +======== + +JSON output plugin for changeset extraction From 4e69671db3ae5762e4d7520e1dc317d10c8a3503 Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Wed, 19 Feb 2014 15:36:16 -0300 Subject: [PATCH 002/154] Copyright update. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f321188bafd4..7bec80b9aebc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014, Euler Taveira de Oliveira +Copyright (c) 2013-2014, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, From 821a54af5a8d60575148fb323dd66e5c48c4261c Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Wed, 19 Feb 2014 15:38:22 -0300 Subject: [PATCH 003/154] Initial commit. The plugin was first named json_decoding_plugin but changed the name after discussion on -hackers. It is a POC to illustrate that it is possible for changeset extraction work just fine. The changeset extraction feature is already in development, hence, it is expected that this code changes a lot until the feature is set in stone. It is based on: repository: git://git.postgresql.org/git/users/andresfreund/postgres.git branch: xlog-decoding-rebasing-remapping commit: 6f819a68cd10938df126ee44a3cfef7f457c8e1b --- Makefile | 55 ++++ expected/bytea.out | 79 +++++ expected/delete1.out | 114 +++++++ expected/delete2.out | 134 ++++++++ expected/delete3.out | 174 ++++++++++ expected/delete4.out | 83 +++++ expected/insert1.out | 111 +++++++ expected/savepoint.out | 99 ++++++ expected/specialvalue.out | 69 ++++ expected/toast.out | 119 +++++++ expected/update1.out | 136 ++++++++ expected/update2.out | 134 ++++++++ expected/update3.out | 167 ++++++++++ expected/update4.out | 90 +++++ sql/bytea.sql | 20 ++ sql/delete1.sql | 84 +++++ sql/delete2.sql | 88 +++++ sql/delete3.sql | 90 +++++ sql/delete4.sql | 39 +++ sql/insert1.sql | 75 +++++ sql/savepoint.sql | 26 ++ sql/specialvalue.sql | 19 ++ sql/toast.sql | 31 ++ sql/update1.sql | 87 +++++ sql/update2.sql | 88 +++++ sql/update3.sql | 88 +++++ sql/update4.sql | 40 +++ wal2json.c | 672 ++++++++++++++++++++++++++++++++++++++ 28 files changed, 3011 insertions(+) create mode 100644 Makefile create mode 100644 expected/bytea.out create mode 100644 expected/delete1.out create mode 100644 expected/delete2.out create mode 100644 expected/delete3.out create mode 100644 expected/delete4.out create mode 100644 expected/insert1.out create mode 100644 expected/savepoint.out create mode 100644 expected/specialvalue.out create mode 100644 expected/toast.out create mode 100644 expected/update1.out create mode 100644 expected/update2.out create mode 100644 expected/update3.out create mode 100644 expected/update4.out create mode 100644 sql/bytea.sql create mode 100644 sql/delete1.sql create mode 100644 sql/delete2.sql create mode 100644 sql/delete3.sql create mode 100644 sql/delete4.sql create mode 100644 sql/insert1.sql create mode 100644 sql/savepoint.sql create mode 100644 sql/specialvalue.sql create mode 100644 sql/toast.sql create mode 100644 sql/update1.sql create mode 100644 sql/update2.sql create mode 100644 sql/update3.sql create mode 100644 sql/update4.sql create mode 100644 wal2json.c diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..a6a5903c2711 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# contrib/wal2json/Makefile + +MODULE_big = wal2json +OBJS = wal2json.o + +# Note: because we don't tell the Makefile there are any regression tests, +# we have to clean those result files explicitly +EXTRA_CLEAN = -r $(pg_regress_clean_files) + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = contrib/wal2json +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif + +# Disabled because these tests require "wal_level=logical", which +# typical installcheck users do not have (e.g. buildfarm clients). +installcheck:; + +# But it can nonetheless be very helpful to run tests on preexisting +# installation, allow to do so, but only if requested explicitly. +installcheck-force: regresscheck-install-force + +check: regresscheck + +submake-regress: + $(MAKE) -C $(top_builddir)/src/test/regress all + +submake-test_decoding: + $(MAKE) -C $(top_builddir)/contrib/test_decoding + +REGRESSCHECKS=insert1 update1 update2 update3 update4 delete1 delete2 delete3 delete4 \ + savepoint specialvalue toast bytea + +regresscheck: all | submake-regress submake-test_decoding + $(pg_regress_check) \ + --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf \ + --temp-install=./tmp_check \ + --extra-install=contrib/wal2json \ + --extra-install=contrib/test_decoding \ + $(REGRESSCHECKS) + +regresscheck-install-force: | submake-regress submake-test_decoding + $(pg_regress_installcheck) \ + --extra-install=contrib/wal2json \ + --extra-install=contrib/test_decoding \ + $(REGRESSCHECKS) + +PHONY: check submake-regress submake-test_decoding \ + regresscheck regresscheck-install-force diff --git a/expected/bytea.out b/expected/bytea.out new file mode 100644 index 000000000000..ee7019aaa5ce --- /dev/null +++ b/expected/bytea.out @@ -0,0 +1,79 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS xpto; +SELECT setseed(0); + setseed +--------- + +(1 row) + +CREATE TABLE xpto ( +id serial primary key, +rand1 float8 DEFAULT random(), +bincol bytea +); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO xpto (bincol) VALUES('2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809'); +UPDATE xpto SET rand1 = 123.456 WHERE id = 1; +DELETE FROM xpto WHERE id = 1; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: column "bincol" has an unchanged TOAST +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/180AF20 + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "bincol"], + + "columntypes": ["int4", "float8", "bytea"], + + "columnvalues": [1, 0.840187716763467, "326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039"]+ + } + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1"], + + "columntypes": ["int4", "float8"], + + "columnvalues": [1, 123.456], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + ] + + } +(9 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/delete1.out b/expected/delete1.out new file mode 100644 index 000000000000..c7a2f44adf63 --- /dev/null +++ b/expected/delete1.out @@ -0,0 +1,114 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- DELETE: no pk +DELETE FROM table_without_pk WHERE b = 1; +-- DELETE: pk +DELETE FROM table_with_pk WHERE b = 1; +-- DELETE: unique +DELETE FROM table_with_unique WHERE b = 1; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1781EE8 +WARNING: table "table_with_unique" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1782018 + data +----------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_pk", + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"],+ + "keyvalues": [1, 2, 3] + + } + + } + ] + + } + { + + "change": [ + ] + + } +(7 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/delete2.out b/expected/delete2.out new file mode 100644 index 000000000000..cfdf4b1d1859 --- /dev/null +++ b/expected/delete2.out @@ -0,0 +1,134 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- DELETE: REPLICA IDENTITY NOTHING +ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; +DELETE FROM table_with_pk WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_without_pk REPLICA IDENTITY NOTHING; +DELETE FROM table_without_pk WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; +DELETE FROM table_with_unique WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: table "table_with_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A9528 +WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A99B8 +WARNING: table "table_with_unique" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A9E48 + data +--------------------- + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } +(18 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/delete3.out b/expected/delete3.out new file mode 100644 index 000000000000..001dc12f31f0 --- /dev/null +++ b/expected/delete3.out @@ -0,0 +1,174 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- DELETE: REPLICA IDENTITY FULL +ALTER TABLE table_with_pk REPLICA IDENTITY FULL; +DELETE FROM table_with_pk WHERE b = 1; +DELETE FROM table_with_pk WHERE n = true; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_without_pk REPLICA IDENTITY FULL; +DELETE FROM table_without_pk WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_with_unique REPLICA IDENTITY FULL; +DELETE FROM table_with_unique WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_pk", + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_pk", + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [2, 4, 5, 6, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_without_pk", + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_unique", + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } +(24 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/delete4.out b/expected/delete4.out new file mode 100644 index 000000000000..a278aa8fdd3c --- /dev/null +++ b/expected/delete4.out @@ -0,0 +1,83 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- DELETE: REPLICA IDENTITY INDEX +ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; +DELETE FROM table_with_unique WHERE b = 1; +DELETE FROM table_with_unique WHERE n = true; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +----------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_unique", + + "oldkeys": { + + "keynames": ["g", "n"], + + "keytypes": ["float8", "bool"],+ + "keyvalues": [1.23, false] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_unique", + + "oldkeys": { + + "keynames": ["g", "n"], + + "keytypes": ["float8", "bool"],+ + "keyvalues": [4.56, true] + + } + + } + ] + + } + { + + "change": [ + ] + + } +(10 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/insert1.out b/expected/insert1.out new file mode 100644 index 000000000000..49bbec0843c4 --- /dev/null +++ b/expected/insert1.out @@ -0,0 +1,111 @@ +-- this is the first test (CREATE EXTENSION, no DROP TABLE) +CREATE EXTENSION test_decoding; +-- predictability +SET synchronous_commit = on; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- INSERT +BEGIN; +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +COMMIT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_without_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_with_unique", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + ] + + } +(5 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/savepoint.out b/expected/savepoint.out new file mode 100644 index 000000000000..821a7e82a529 --- /dev/null +++ b/expected/savepoint.out @@ -0,0 +1,99 @@ +-- predictability +SET synchronous_commit = on; +CREATE TABLE xpto (a SERIAL PRIMARY KEY, b text); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO xpto (b) VALUES('john'); +INSERT INTO xpto (b) VALUES('smith'); +INSERT INTO xpto (b) VALUES('robert'); +BEGIN; +INSERT INTO xpto (b) VALUES('marie'); +SAVEPOINT sp1; +INSERT INTO xpto (b) VALUES('ernesto'); +SAVEPOINT sp2; +INSERT INTO xpto (b) VALUES('peter'); -- discard +SAVEPOINT sp3; +INSERT INTO xpto (b) VALUES('albert'); -- discard +ROLLBACK TO SAVEPOINT sp2; +RELEASE SAVEPOINT sp1; +INSERT INTO xpto (b) VALUES('francisco'); +END; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +---------------------------------------------------------- + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [1, "john"] + + } + ] + + } + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [2, "smith"] + + } + ] + + } + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [3, "robert"] + + } + ] + + } + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [4, "marie"] + + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [5, "ernesto"] + + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "text"],+ + "columnvalues": [8, "francisco"]+ + } + ] + + } +(14 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/specialvalue.out b/expected/specialvalue.out new file mode 100644 index 000000000000..4f84baed97d7 --- /dev/null +++ b/expected/specialvalue.out @@ -0,0 +1,69 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS xpto; +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +CREATE TABLE xpto (a SERIAL PRIMARY KEY, b bool, c varchar(60), d real); +COMMIT; +WARNING: there is no transaction in progress +BEGIN; +INSERT INTO xpto (b, c, d) VALUES('t', 'test1', '+inf'); +INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); +INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); +INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); +COMMIT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +-------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [1, true, "test1", null] + + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [2, false, "test2", null] + + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [3, null, "null", null] + + } + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [4, true, "valid: ' \" \\ \/ \b \f \n \r \t ⁿ 陿 invalid: \\g \\k end", 123.456]+ + } + ] + + } +(8 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/toast.out b/expected/toast.out new file mode 100644 index 000000000000..01d7d1becdd9 --- /dev/null +++ b/expected/toast.out @@ -0,0 +1,119 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS xpto; +SELECT setseed(0); + setseed +--------- + +(1 row) + +CREATE TABLE xpto ( +id serial primary key, +toasted_col1 text, +rand1 float8 DEFAULT random(), +toasted_col2 text, +rand2 float8 DEFAULT random() +); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- uncompressed external toast data +INSERT INTO xpto (toasted_col1, toasted_col2) SELECT string_agg(g.i::text, ''), string_agg((g.i*2)::text, '') FROM generate_series(1, 2000) g(i); +-- compressed external toast data +INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), ''), 50) FROM generate_series(1, 500) g(i); +-- update of existing column +UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; +UPDATE xpto SET rand1 = 123.456 WHERE id = 1; +DELETE FROM xpto WHERE id = 1; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: column "toasted_col2" has an unchanged TOAST +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FED90 +WARNING: column "toasted_col1" has an unchanged TOAST +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FEE60 +WARNING: column "toasted_col2" has an unchanged TOAST +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FEE60 + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + + "columntypes": ["int4", "text", "float8", "text", "float8"], + + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 0.840187716763467, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 0.394382926635444] + + } + ] + + } + { + + "change": [ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + + "columntypes": ["int4", "text", "float8", "text", "float8"], + + "columnvalues": [2, null, 0.783099223393947, "0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500", 0.798440033104271]+ + } + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "rand2"], + + "columntypes": ["int4", "text", "float8", "float8"], + + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 0.840187716763467, 0.394382926635444], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "rand2"], + + "columntypes": ["int4", "float8", "float8"], + + "columnvalues": [1, 123.456, 0.394382926635444], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + ] + + } +(15 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/update1.out b/expected/update1.out new file mode 100644 index 000000000000..cacebc0775a3 --- /dev/null +++ b/expected/update1.out @@ -0,0 +1,136 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- UPDATE: no pk +UPDATE table_without_pk SET f = -f WHERE b = 1; +-- UPDATE: no pk change +UPDATE table_with_pk SET f = -f WHERE b = 1; +-- UPDATE: pk change +UPDATE table_with_pk SET b = -b WHERE b = 1; +-- UPDATE: unique +UPDATE table_with_unique SET n = false WHERE b = 1; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1700320 +WARNING: table "table_with_unique" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17006D8 + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"], + + "keyvalues": [1, 2, 3] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, -1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"],+ + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"], + + "keyvalues": [1, 2, 3] + + } + + } + ] + + } + { + + "change": [ + ] + + } +(10 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/update2.out b/expected/update2.out new file mode 100644 index 000000000000..6451ae5b7888 --- /dev/null +++ b/expected/update2.out @@ -0,0 +1,134 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- UPDATE: REPLICA IDENTITY NOTHING +ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; +UPDATE table_with_pk SET f = -f WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_without_pk REPLICA IDENTITY NOTHING; +UPDATE table_without_pk SET f = -f WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; +UPDATE table_with_unique SET f = -f WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +WARNING: table "table_with_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1725E70 +WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17263B0 +WARNING: table "table_with_unique" without primary key or replica identity is nothing +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1726918 + data +--------------------- + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } +(18 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/update3.out b/expected/update3.out new file mode 100644 index 000000000000..37005e57e5bf --- /dev/null +++ b/expected/update3.out @@ -0,0 +1,167 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- UPDATE: REPLICA IDENTITY FULL +ALTER TABLE table_with_pk REPLICA IDENTITY FULL; +UPDATE table_with_pk SET f = -f WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_without_pk REPLICA IDENTITY FULL; +UPDATE table_without_pk SET f = -f WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; +ALTER TABLE table_with_unique REPLICA IDENTITY FULL; +UPDATE table_with_unique SET f = -f WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_without_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_unique", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ + } + + } + ] + + } + { + + "change": [ + ] + + } +(21 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/update4.out b/expected/update4.out new file mode 100644 index 000000000000..eacceaecdb6a --- /dev/null +++ b/expected/update4.out @@ -0,0 +1,90 @@ +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_unique; +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); +-- INSERT +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- UPDATE: REPLICA IDENTITY USING INDEX +ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; +-- FIXME não apresenta valor correto de g +UPDATE table_with_unique SET c = -c WHERE b = 1; +UPDATE table_with_unique SET g = -g WHERE n = true; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_unique", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, -2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", false, "{ \"a\": 123 }", "'Old' 'Parr'"],+ + "oldkeys": { + + "keynames": ["g", "n"], + + "keytypes": ["float8", "bool"], + + "keyvalues": [1.23, false] + + } + + } + ] + + } + { + + "change": [ + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_unique", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [2, 4, 5, 6, 3.540, 876.563, -4.56, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["g", "n"], + + "keytypes": ["float8", "bool"], + + "keyvalues": [4.56, true] + + } + + } + ] + + } + { + + "change": [ + ] + + } +(10 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/bytea.sql b/sql/bytea.sql new file mode 100644 index 000000000000..9c6ed9df3b1c --- /dev/null +++ b/sql/bytea.sql @@ -0,0 +1,20 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS xpto; + +SELECT setseed(0); +CREATE TABLE xpto ( +id serial primary key, +rand1 float8 DEFAULT random(), +bincol bytea +); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO xpto (bincol) VALUES('2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809'); +UPDATE xpto SET rand1 = 123.456 WHERE id = 1; +DELETE FROM xpto WHERE id = 1; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete1.sql b/sql/delete1.sql new file mode 100644 index 000000000000..3887d569d946 --- /dev/null +++ b/sql/delete1.sql @@ -0,0 +1,84 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- DELETE: no pk +DELETE FROM table_without_pk WHERE b = 1; + +-- DELETE: pk +DELETE FROM table_with_pk WHERE b = 1; + +-- DELETE: unique +DELETE FROM table_with_unique WHERE b = 1; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql new file mode 100644 index 000000000000..585c46cab80f --- /dev/null +++ b/sql/delete2.sql @@ -0,0 +1,88 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- DELETE: REPLICA IDENTITY NOTHING +ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; +DELETE FROM table_with_pk WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_without_pk REPLICA IDENTITY NOTHING; +DELETE FROM table_without_pk WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; +DELETE FROM table_with_unique WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql new file mode 100644 index 000000000000..981713e62e2a --- /dev/null +++ b/sql/delete3.sql @@ -0,0 +1,90 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- DELETE: REPLICA IDENTITY FULL +ALTER TABLE table_with_pk REPLICA IDENTITY FULL; +DELETE FROM table_with_pk WHERE b = 1; +DELETE FROM table_with_pk WHERE n = true; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_without_pk REPLICA IDENTITY FULL; +DELETE FROM table_without_pk WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_with_unique REPLICA IDENTITY FULL; +DELETE FROM table_with_unique WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql new file mode 100644 index 000000000000..e42e6ba14d1b --- /dev/null +++ b/sql/delete4.sql @@ -0,0 +1,39 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- DELETE: REPLICA IDENTITY INDEX +ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; +DELETE FROM table_with_unique WHERE b = 1; +DELETE FROM table_with_unique WHERE n = true; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql new file mode 100644 index 000000000000..f65f4350415d --- /dev/null +++ b/sql/insert1.sql @@ -0,0 +1,75 @@ +-- this is the first test (CREATE EXTENSION, no DROP TABLE) +CREATE EXTENSION test_decoding; +-- predictability +SET synchronous_commit = on; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- INSERT +BEGIN; +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +COMMIT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql new file mode 100644 index 000000000000..13dc1780d3e2 --- /dev/null +++ b/sql/savepoint.sql @@ -0,0 +1,26 @@ +-- predictability +SET synchronous_commit = on; + +CREATE TABLE xpto (a SERIAL PRIMARY KEY, b text); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO xpto (b) VALUES('john'); +INSERT INTO xpto (b) VALUES('smith'); +INSERT INTO xpto (b) VALUES('robert'); + +BEGIN; +INSERT INTO xpto (b) VALUES('marie'); +SAVEPOINT sp1; +INSERT INTO xpto (b) VALUES('ernesto'); +SAVEPOINT sp2; +INSERT INTO xpto (b) VALUES('peter'); -- discard +SAVEPOINT sp3; +INSERT INTO xpto (b) VALUES('albert'); -- discard +ROLLBACK TO SAVEPOINT sp2; +RELEASE SAVEPOINT sp1; +INSERT INTO xpto (b) VALUES('francisco'); +END; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql new file mode 100644 index 000000000000..00a4986c3d12 --- /dev/null +++ b/sql/specialvalue.sql @@ -0,0 +1,19 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS xpto; + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +CREATE TABLE xpto (a SERIAL PRIMARY KEY, b bool, c varchar(60), d real); +COMMIT; + +BEGIN; +INSERT INTO xpto (b, c, d) VALUES('t', 'test1', '+inf'); +INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); +INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); +INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); +COMMIT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql new file mode 100644 index 000000000000..dcf447a6c69e --- /dev/null +++ b/sql/toast.sql @@ -0,0 +1,31 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS xpto; + +SELECT setseed(0); +CREATE TABLE xpto ( +id serial primary key, +toasted_col1 text, +rand1 float8 DEFAULT random(), +toasted_col2 text, +rand2 float8 DEFAULT random() +); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- uncompressed external toast data +INSERT INTO xpto (toasted_col1, toasted_col2) SELECT string_agg(g.i::text, ''), string_agg((g.i*2)::text, '') FROM generate_series(1, 2000) g(i); + +-- compressed external toast data +INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), ''), 50) FROM generate_series(1, 500) g(i); + +-- update of existing column +UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; + +UPDATE xpto SET rand1 = 123.456 WHERE id = 1; + +DELETE FROM xpto WHERE id = 1; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql new file mode 100644 index 000000000000..76664ab8802c --- /dev/null +++ b/sql/update1.sql @@ -0,0 +1,87 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- UPDATE: no pk +UPDATE table_without_pk SET f = -f WHERE b = 1; + +-- UPDATE: no pk change +UPDATE table_with_pk SET f = -f WHERE b = 1; + +-- UPDATE: pk change +UPDATE table_with_pk SET b = -b WHERE b = 1; + +-- UPDATE: unique +UPDATE table_with_unique SET n = false WHERE b = 1; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql new file mode 100644 index 000000000000..0db94e55dda6 --- /dev/null +++ b/sql/update2.sql @@ -0,0 +1,88 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- UPDATE: REPLICA IDENTITY NOTHING +ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; +UPDATE table_with_pk SET f = -f WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_without_pk REPLICA IDENTITY NOTHING; +UPDATE table_without_pk SET f = -f WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; +UPDATE table_with_unique SET f = -f WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql new file mode 100644 index 000000000000..ac58cc013a93 --- /dev/null +++ b/sql/update3.sql @@ -0,0 +1,88 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; +DROP TABLE IF EXISTS table_without_pk; +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +CREATE TABLE table_without_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector +); + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- UPDATE: REPLICA IDENTITY FULL +ALTER TABLE table_with_pk REPLICA IDENTITY FULL; +UPDATE table_with_pk SET f = -f WHERE b = 1; +ALTER TABLE table_with_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_without_pk REPLICA IDENTITY FULL; +UPDATE table_without_pk SET f = -f WHERE b = 1; +ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; + +ALTER TABLE table_with_unique REPLICA IDENTITY FULL; +UPDATE table_with_unique SET f = -f WHERE b = 1; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql new file mode 100644 index 000000000000..e4c683349430 --- /dev/null +++ b/sql/update4.sql @@ -0,0 +1,40 @@ +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_unique; + +CREATE TABLE table_with_unique ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3) not null, +f real not null, +g double precision not null, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +UNIQUE(g, n) +); + +-- INSERT +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); + +-- UPDATE: REPLICA IDENTITY USING INDEX +ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; +-- FIXME não apresenta valor correto de g +UPDATE table_with_unique SET c = -c WHERE b = 1; +UPDATE table_with_unique SET g = -g WHERE n = true; +ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; + +SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c new file mode 100644 index 000000000000..7786b498daa3 --- /dev/null +++ b/wal2json.c @@ -0,0 +1,672 @@ +/*------------------------------------------------------------------------- + * + * wal2json.c + * JSON output plugin for changeset extraction + * + * Copyright (c) 2013, PostgreSQL Global Development Group + * + * IDENTIFICATION + * contrib/wal2json/wal2json.c + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "access/sysattr.h" + +#include "catalog/pg_class.h" +#include "catalog/pg_type.h" +#include "catalog/index.h" + +#include "nodes/parsenodes.h" + +#include "replication/output_plugin.h" +#include "replication/logical.h" + +#include "utils/builtins.h" +#include "utils/lsyscache.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/relcache.h" +#include "utils/syscache.h" +#include "utils/typcache.h" + +PG_MODULE_MAGIC; + +extern void _PG_init(void); +extern void _PG_output_plugin_init(OutputPluginCallbacks *cb); + +typedef struct +{ + MemoryContext context; + bool include_xids; /* include transaction ids */ + bool include_timestamp; /* include transaction timestamp */ + bool include_schemas; /* qualify tables */ + bool include_types; /* include data types */ + + uint64 nr_changes; /* # of passes in pg_decode_change() */ + /* FIXME replace with txn->nentries */ +} JsonDecodingData; + +/* These must be available to pg_dlsym() */ +static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is_init); +static void pg_decode_shutdown(LogicalDecodingContext *ctx); +static void pg_decode_begin_txn(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn); +static void pg_decode_commit_txn(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr commit_lsn); +static void pg_decode_change(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, Relation rel, + ReorderBufferChange *change); + +void +_PG_init(void) +{ +} + +/* Specify output plugin callbacks */ +void +_PG_output_plugin_init(OutputPluginCallbacks *cb) +{ + AssertVariableIsOfType(&_PG_output_plugin_init, LogicalOutputPluginInit); + + cb->startup_cb = pg_decode_startup; + cb->begin_cb = pg_decode_begin_txn; + cb->change_cb = pg_decode_change; + cb->commit_cb = pg_decode_commit_txn; + cb->shutdown_cb = pg_decode_shutdown; +} + +/* Initialize this plugin */ +void +pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is_init) +{ + ListCell *option; + JsonDecodingData *data; + + data = palloc(sizeof(JsonDecodingData)); + data->context = AllocSetContextCreate(TopMemoryContext, + "text conversion context", + ALLOCSET_DEFAULT_MINSIZE, + ALLOCSET_DEFAULT_INITSIZE, + ALLOCSET_DEFAULT_MAXSIZE); + data->include_xids = true; + data->include_timestamp = false; + data->include_schemas = true; + data->include_types = true; + + data->nr_changes = 0; + + ctx->output_plugin_private = data; + + opt->output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT; + + foreach(option, ctx->output_plugin_options) + { + DefElem *elem = lfirst(option); + + Assert(elem->arg == NULL || IsA(elem->arg, String)); + + if (strcmp(elem->defname, "include-xids") == 0) + { + /* If option does not provide a value, it means its value is true */ + if (elem->arg == NULL) + { + elog(LOG, "include-xids argument is null"); + data->include_xids = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_xids)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + else if (strcmp(elem->defname, "include-timestamp") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-timestamp argument is null"); + data->include_timestamp = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_timestamp)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + else if (strcmp(elem->defname, "include-schemas") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-schemas argument is null"); + data->include_schemas = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_schemas)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + else if (strcmp(elem->defname, "include-types") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-types argument is null"); + data->include_types = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_types)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + else + { + elog(WARNING, "option %s = %s is unknown", + elem->defname, elem->arg ? strVal(elem->arg) : "(null)"); + } + } +} + +/* cleanup this plugin's resources */ +static void +pg_decode_shutdown(LogicalDecodingContext *ctx) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + /* cleanup our own resources via memory context reset */ + MemoryContextDelete(data->context); +} + +/* BEGIN callback */ +void +pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + data->nr_changes = 0; + + /* Transaction starts */ + OutputPluginPrepareWrite(ctx, true); + + appendStringInfoString(ctx->out, "{\n"); + + if (data->include_xids) + appendStringInfo(ctx->out, "\t\"xid\": %u,\n", txn->xid); + + if (data->include_timestamp) + appendStringInfo(ctx->out, "\t\"timestamp\": \"%s\",\n", timestamptz_to_str(txn->commit_time)); + + appendStringInfoString(ctx->out, "\t\"change\": ["); + + OutputPluginWrite(ctx, true); +} + +/* COMMIT callback */ +void +pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr commit_lsn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + if (txn->has_catalog_changes) + elog(DEBUG1, "txn has catalog changes: yes"); + else + elog(DEBUG1, "txn has catalog changes: no"); + elog(DEBUG1, "my change counter: %lu ; # of changes: %lu ; # of changes in memory: %lu", data->nr_changes, txn->nentries, txn->nentries_mem); + elog(DEBUG1, "# of subxacts: %d", txn->nsubtxns); + + /* Transaction ends */ + OutputPluginPrepareWrite(ctx, true); + + appendStringInfoString(ctx->out, "\t]\n}"); + + OutputPluginWrite(ctx, true); +} + +/* + * Format a string as a JSON literal + * XXX it doesn't do a sanity check for invalid input, does it? + * FIXME it doesn't handle \uxxxx + */ +static void +quote_escape_json(StringInfo buf, const char *val) +{ + const char *valptr; + + appendStringInfoChar(buf, '"'); + for (valptr = val; *valptr; valptr++) + { + char ch = *valptr; + + /* XXX suppress \x in bytea field? */ + if (ch == '\\' && *(valptr + 1) == 'x') + { + valptr++; + continue; + } + + switch (ch) + { + case '"': + case '\\': + case '/': + appendStringInfo(buf, "\\%c", ch); + break; + case '\b': + appendStringInfoString(buf, "\\b"); + break; + case '\f': + appendStringInfoString(buf, "\\f"); + break; + case '\n': + appendStringInfoString(buf, "\\n"); + break; + case '\r': + appendStringInfoString(buf, "\\r"); + break; + case '\t': + appendStringInfoString(buf, "\\t"); + break; + default: + appendStringInfoChar(buf, ch); + break; + } + } + appendStringInfoChar(buf, '"'); +} + +/* + * Accumulate tuple information and stores it at the end + * + * replident: is this tuple a replica identity? + * hasreplident: does this tuple has an associated replica identity? + */ +static void +tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident) +{ + JsonDecodingData *data; + int natt; + + StringInfoData colnames; + StringInfoData coltypes; + StringInfoData colvalues; + char *comma = ""; + + initStringInfo(&colnames); + initStringInfo(&coltypes); + initStringInfo(&colvalues); + + data = ctx->output_plugin_private; + + /* + * If replident is true, it will output info about replica identity. In this + * case, there are special JSON objects for it. Otherwise, it will print new + * tuple data. + */ + if (replident) + { + appendStringInfoString(&colnames, "\t\t\t\"oldkeys\": {\n"); + appendStringInfoString(&colnames, "\t\t\t\t\"keynames\": ["); + appendStringInfoString(&coltypes, "\t\t\t\t\"keytypes\": ["); + appendStringInfoString(&colvalues, "\t\t\t\t\"keyvalues\": ["); + } + else + { + appendStringInfoString(&colnames, "\t\t\t\"columnnames\": ["); + appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); + appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); + } + + /* Print column information (name, type, value) */ + for (natt = 0; natt < tupdesc->natts; natt++) + { + Form_pg_attribute attr; /* the attribute itself */ + Oid typid; /* type of current attribute */ + HeapTuple type_tuple; /* information about a type */ + Form_pg_type type_form; + Oid typoutput; /* output function */ + bool typisvarlena; + Datum origval; /* possibly toasted Datum */ + Datum val; /* definitely detoasted Datum */ + char *outputstr = NULL; + bool isnull; /* column is null? */ + + attr = tupdesc->attrs[natt]; + + elog(DEBUG1, "attribute \"%s\" (%d/%d)", NameStr(attr->attname), natt, tupdesc->natts); + + /* Do not print dropped or system columns */ + if (attr->attisdropped || attr->attnum < 0) + continue; + + /* Search indexed columns in whole heap tuple */ + if (indexdesc != NULL) + { + int j; + bool found_col = false; + + for (j = 0; j < indexdesc->natts; j++) + { + if (strcmp(NameStr(attr->attname), NameStr(indexdesc->attrs[j]->attname)) == 0) + found_col = true; + } + + /* Print only indexed columns */ + if (!found_col) + continue; + } + + typid = attr->atttypid; + + /* Figure out type name */ + type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (!HeapTupleIsValid(type_tuple)) + elog(ERROR, "cache lookup failed for type %u", typid); + type_form = (Form_pg_type) GETSTRUCT(type_tuple); + + /* Get information needed for printing values of a type */ + getTypeOutputInfo(typid, &typoutput, &typisvarlena); + + /* Get Datum from tuple */ + origval = fastgetattr(tuple, natt + 1, tupdesc, &isnull); + + /* Skip nulls iif printing key/identity */ + if (isnull && replident) + continue; + + /* XXX Unchanged TOAST Datum does not need to be output */ + if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) + { + elog(WARNING, "column \"%s\" has an unchanged TOAST", NameStr(attr->attname)); + continue; + } + + /* Accumulate each column info */ + appendStringInfo(&colnames, "%s\"%s\"", comma, NameStr(attr->attname)); + + if (data->include_types) + appendStringInfo(&coltypes, "%s\"%s\"", comma, NameStr(type_form->typname)); + + ReleaseSysCache(type_tuple); + + if (isnull) + { + appendStringInfo(&colvalues, "%snull", comma); + } + else + { + if (typisvarlena) + val = PointerGetDatum(PG_DETOAST_DATUM(origval)); + else + val = origval; + + /* Finally got the value */ + outputstr = OidOutputFunctionCall(typoutput, val); + + /* + * Data types are printed with quotes unless they are number, true, + * false, null, an array or an object. + * + * The NaN and Infinity are not valid JSON symbols. Hence, + * regardless of sign they are represented as the string null. + */ + switch (typid) + { + case INT2OID: + case INT4OID: + case INT8OID: + case OIDOID: + case FLOAT4OID: + case FLOAT8OID: + case NUMERICOID: + if (pg_strncasecmp(outputstr, "NaN", 3) == 0 || + pg_strncasecmp(outputstr, "Infinity", 8) == 0 || + pg_strncasecmp(outputstr, "-Infinity", 9) == 0) + { + appendStringInfo(&colvalues, "%snull", comma); + elog(DEBUG1, "attribute \"%s\" is special: %s", NameStr(attr->attname), outputstr); + } + else if (strspn(outputstr, "0123456789+-eE.") == strlen(outputstr)) + appendStringInfo(&colvalues, "%s%s", comma, outputstr); + else + elog(ERROR, "%s is not a number", outputstr); + break; + case BOOLOID: + if (strcmp(outputstr, "t") == 0) + appendStringInfo(&colvalues, "%strue", comma); + else + appendStringInfo(&colvalues, "%sfalse", comma); + break; + default: + appendStringInfoString(&colvalues, comma); + quote_escape_json(&colvalues, outputstr); + break; + } + } + + /* The first column does not have comma */ + if (strcmp(comma, "") == 0) + comma = ", "; + } + + /* Column info ends */ + if (replident) + { + appendStringInfoString(&colnames, "],\n"); + if (data->include_types) + appendStringInfoString(&coltypes, "],\n"); + appendStringInfoString(&colvalues, "]\n"); + appendStringInfoString(&colvalues, "\t\t\t}\n"); + } + else + { + appendStringInfoString(&colnames, "],\n"); + if (data->include_types) + appendStringInfoString(&coltypes, "],\n"); + if (hasreplident) + appendStringInfoString(&colvalues, "],\n"); + else + appendStringInfoString(&colvalues, "]\n"); + } + + /* Print data */ + appendStringInfoString(ctx->out, colnames.data); + if (data->include_types) + appendStringInfoString(ctx->out, coltypes.data); + appendStringInfoString(ctx->out, colvalues.data); + + pfree(colnames.data); + pfree(coltypes.data); + pfree(colvalues.data); +} + +/* Print columns information */ +static void +columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident) +{ + tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, hasreplident); +} + +/* Print replica identity information */ +static void +identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc) +{ + /* Last parameter does not matter */ + tuple_to_stringinfo(ctx, tupdesc, tuple, indexdesc, true, false); +} + +/* Callback for individual changed tuples */ +void +pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + Relation relation, ReorderBufferChange *change) +{ + JsonDecodingData *data; + Form_pg_class class_form; + TupleDesc tupdesc; + MemoryContext old; + + Relation indexrel; + TupleDesc indexdesc; + + AssertVariableIsOfType(&pg_decode_change, LogicalDecodeChangeCB); + + data = ctx->output_plugin_private; + class_form = RelationGetForm(relation); + tupdesc = RelationGetDescr(relation); + + /* Avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + OutputPluginPrepareWrite(ctx, true); + + /* Make sure rd_replidindex is set */ + RelationGetIndexList(relation); + + /* Sanity checks */ + switch (change->action) + { + case REORDER_BUFFER_CHANGE_INSERT: + if (change->tp.newtuple == NULL) + { + elog(WARNING, "no tuple data for INSERT in table \"%s\"", NameStr(class_form->relname)); + return; + } + break; + case REORDER_BUFFER_CHANGE_UPDATE: + /* + * Bail out iif: + * (i) doesn't have a pk and replica identity is not full; + * (ii) replica identity is nothing. + */ + if (!OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + { + /* FIXME this sentence is imprecise */ + elog(WARNING, "table \"%s\" without primary key or replica identity is nothing", NameStr(class_form->relname)); + return; + } + + if (change->tp.newtuple == NULL) + { + elog(WARNING, "no tuple data for UPDATE in table \"%s\"", NameStr(class_form->relname)); + return; + } + break; + case REORDER_BUFFER_CHANGE_DELETE: + /* + * Bail out iif: + * (i) doesn't have a pk and replica identity is not full; + * (ii) replica identity is nothing. + */ + if (!OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + { + /* FIXME this sentence is imprecise */ + elog(WARNING, "table \"%s\" without primary key or replica identity is nothing", NameStr(class_form->relname)); + return; + } + + if (change->tp.oldtuple == NULL) + { + elog(WARNING, "no tuple data for DELETE in table \"%s\"", NameStr(class_form->relname)); + return; + } + break; + } + + /* Change counter */ + data->nr_changes++; + + /* Change starts */ + if (data->nr_changes > 1) + appendStringInfoString(ctx->out, "\t\t,{\n"); + else + appendStringInfoString(ctx->out, "\t\t{\n"); + + /* Print change kind */ + switch (change->action) + { + case REORDER_BUFFER_CHANGE_INSERT: + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"insert\",\n"); + break; + case REORDER_BUFFER_CHANGE_UPDATE: + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"update\",\n"); + break; + case REORDER_BUFFER_CHANGE_DELETE: + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"delete\",\n"); + break; + } + + /* Print table name (possibly) qualified */ + if (data->include_schemas) + appendStringInfo(ctx->out, "\t\t\t\"schema\": \"%s\",\n", get_namespace_name(class_form->relnamespace)); + appendStringInfo(ctx->out, "\t\t\t\"table\": \"%s\",\n", NameStr(class_form->relname)); + + switch (change->action) + { + case REORDER_BUFFER_CHANGE_INSERT: + /* Print the new tuple */ + columns_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, false); + break; + case REORDER_BUFFER_CHANGE_UPDATE: + /* Print the new tuple */ + columns_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, true); + + /* + * The old tuple is available when: + * (i) pk changes; + * (ii) replica identity is full; + * (iii) replica identity is index and indexed column changes. + * + * FIXME if old tuple is not available we must get only the indexed + * columns (the whole tuple is printed). + */ + if (change->tp.oldtuple == NULL) + { + elog(DEBUG1, "old tuple is null"); + + indexrel = RelationIdGetRelation(relation->rd_replidindex); + if (indexrel != NULL) + { + indexdesc = RelationGetDescr(indexrel); + identity_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, indexdesc); + RelationClose(indexrel); + } + else + { + identity_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, NULL); + } + } + else + { + elog(DEBUG1, "old tuple is not null"); + identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, NULL); + } + break; + case REORDER_BUFFER_CHANGE_DELETE: + /* Print the replica identity */ + indexrel = RelationIdGetRelation(relation->rd_replidindex); + if (indexrel != NULL) + { + indexdesc = RelationGetDescr(indexrel); + identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, indexdesc); + RelationClose(indexrel); + } + else + { + identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, NULL); + } + + if (change->tp.oldtuple == NULL) + elog(DEBUG1, "old tuple is null"); + else + elog(DEBUG1, "old tuple is not null"); + break; + } + + appendStringInfoString(ctx->out, "\t\t}"); + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + + OutputPluginWrite(ctx, true); +} From 9561828ee03a459bec152dfd568e14b4591c78aa Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Wed, 19 Feb 2014 16:32:21 -0300 Subject: [PATCH 004/154] Generate a long bytea instead of explicitly writing a long one. It reduces the sql file size. Suggested by Merlin Moncure. --- expected/bytea.out | 76 +++++++++++++++++++++++----------------------- sql/bytea.sql | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index ee7019aaa5ce..3ba639ce8163 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -18,56 +18,56 @@ SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2j init (1 row) -INSERT INTO xpto (bincol) VALUES('2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809'); +INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); WARNING: column "bincol" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/180AF20 - data --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { + +CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/180CA18 + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + { + "change": [ - { + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "rand1", "bincol"], + - "columntypes": ["int4", "float8", "bytea"], + - "columnvalues": [1, 0.840187716763467, "326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039203265623263393631633163626636206366386437623638636239613266333620376262656462346165372030366563343663353536313161343636656237653365646363303039636136206520356564396364306561356134653535643630313032376335366120203634636163663361343261666320393065363330303063333435303639393333343533353536343020373962636520313733626237206335203537346561376339323163623066323520303839643536643136646666323466333336653437343020363837303437306631663961666362346637633536633966206239376531313766633936352037303133303239206534386636646434383120376430306531653232376265656638346139203930346434633334323431662063623563306631342033613861373020663531613733313634653932303532666262353362346363326631666564203363336665636161303237303137352032353231656630333539342066613035373536383132363438663435306662203133633266206233396130373239643631383265392031356235656132303466653733206438393931616664373264323161636431383864663120613239666666353761623839373333382064653534396233656435613032343533346330303731323563203266636633653563336533203734323762366461656335633366203437332038206135643920383430343130393736616332656561623538653163613862663436633262372031646239636338356133333666313239316561313939323220646238303866333534386364613931203265333739636538306166313262643765643536643033333863206120656136376137633834376636363230666338393466306261313030343420306520353265393764393735616637323031643820643935653666303831383464386666203139373632343736666120343266323738663335333466336632626530616261656437312066306162613131383335653465316439342065383533346366363737303436656166623866356637363138363520666662656532373363376262203262623737663665373830206337376538313835316334393120652061396634356437363562303161303330643564333137206666373334356132326263333630206338373336336261313231323937623036336538332031336561333265393631386420343033303466366332613765393263316336366666343230386520613738316234613231343139616266646635656234363765346434383930382038613635363536653531346232623365663866383633313061616638352034203930623762323836326533646263386630656566336466633630373562666120656239346131632061353861626235646566346661343338343065366532373136203236306536656165626220343234313564373132626638333934346463643132303465203330353235346663336238343931353062352035626264376638343731646364333632312032616530353438313135613235302030633139383865392037366639386265663435363339623720306435613238663031646320623731206330343635373666616134643439656666382063316538643031632031306338366334353765613035303435356137343264613466382065613736373661663835633731633765656361363335203661303731333732323734303464206134203731383631373220383135306633316339613135343031632066316262393035376139393338626661203232623438326265303866343234656334203231646165613939343239333538392031356266663339336636623137666566323437383664643666392064356132642034623362356464393337303534336520623461393362326163343334313934356430362064333834343437383132653020346533633937653962386637206637643464363434623261316433373320353130326320623935333166373235363734623238203161613136653765333432383537393763313433392035316161373632656131346234306662383837366338383765656136203435613632643364356433653934363235303930343639373438363539312062336631613820323433353234373637626638343664203820393520343561393232383732206464323439376562316533646138643531336432203738323164623965313464346620323463346630383564653630643763306336656133666336626320653463396638633638353936643764206166643663386362306632353136623837663234626264382036316432653435376337303934392064326433363263646336353720333630356639643237666436643732203332646539316436366665356266353337353330203835396531613038623635203962356135356620343131366364613966646465623834333936343030322065383166336232633063613536366164336462626336653233342030643362316435342031306334343062653563306263613935203764616438343166206136316630343139363739373265383035636366656535356320646565653963633136653932616231393720373632373535343037336331663536623965203231626562636266643265323238326638342037623132316138336565623931646238626461383162613838633633346234363339342035393838356562633733373631376164646161663063623830392032656232633936316331636266362063663864376236386362396132663336203762626564623461653720303665633436633535363131613436366562376533656463633030396361362065203565643963643065613561346535356436303130323763353661202036346361636633613432616663203930653633303030633334353036393933333435333535363430203739626365203137336262372063352035373465613763393231636230663235203038396435366431366466663234663333366534373430203638373034373066316639616663623466376335366339662062393765313137666339363520373031333032392065343866366464343831203764303065316532323762656566383461392039303464346333343234316620636235633066313420336138613730206635316137333136346539323035326662623533623463633266316665642033633366656361613032373031373520323532316566303335393420666130353735363831323634386634353066622031336332662062333961303732396436313832653920313562356561323034666537332064383939316166643732643231616364313838646631206132396666663537616238393733333820646535343962336564356130323435333463303037313235632032666366336535633365332037343237623664616563356333662034373320382061356439203834303431303937366163326565616235386531636138626634366332623720316462396363383561333336663132393165613139393232206462383038663335343863646139312032653337396365383061663132626437656435366430333338632061206561363761376338343766363632306663383934663062613130303434203065203532653937643937356166373230316438206439356536663038313834643866662031393736323437366661203432663237386633353334663366326265306162616564373120663061626131313833356534653164393420653835333463663637373034366561666238663566373631383635206666626565323733633762622032626237376636653738302063373765383138353163343931206520613966343564373635623031613033306435643331372066663733343561323262633336302063383733363362613132313239376230363365383320313365613332653936313864203430333034663663326137653932633163363666663432303865206137383162346132313431396162666466356562343637653464343839303820386136353635366535313462326233656638663836333130616166383520342039306237623238363265336462633866306565663364666336303735626661206562393461316320613538616262356465663466613433383430653665323731362032363065366561656262203432343135643731326266383339343464636431323034652033303532353466633362383439313530623520356262643766383437316463643336323120326165303534383131356132353020306331393838653920373666393862656634353633396237203064356132386630316463206237312063303436353736666161346434396566663820633165386430316320313063383663343537656130353034353561373432646134663820656137363736616638356337316337656563613633352036613037313337323237343034642061342037313836313732203831353066333163396131353430316320663162623930353761393933386266612032326234383262653038663432346563342032316461656139393432393335383920313562666633393366366231376665663234373836646436663920643561326420346233623564643933373035343365206234613933623261633433343139343564303620643338343434373831326530203465336339376539623866372066376434643634346232613164333733203531303263206239353331663732353637346232382031616131366537653334323835373937633134333920353161613736326561313462343066623838373663383837656561362034356136326433643564336539343632353039303436393734383635393120623366316138203234333532343736376266383436642038203935203435613932323837322064643234393765623165336461386435313364322037383231646239653134643466203234633466303835646536306437633063366561336663366263206534633966386336383539366437642061666436633863623066323531366238376632346262643820363164326534353763373039343920643264333632636463363537203336303566396432376664366437322033326465393164363666653562663533373533302038353965316130386236352039623561353566203431313663646139666464656238343339363430303220653831663362326330636135363661643364626263366532333420306433623164353420313063343430626535633062636139352037646164383431662061363166303431393637393732653830356363666565353563206465656539636331366539326162313937203736323735353430373363316635366239652032316265626362666432653232383266383420376231323161383365656239316462386264613831626138386336333462343633393420353938383565626337333736313761646461616630636238303920326562326339363163316362663620636638643762363863623961326633362037626265646234616537203036656334366335353631316134363665623765336564636330303963613620652035656439636430656135613465353564363031303237633536612020363463616366336134326166632039306536333030306333343530363939333334353335353634302037396263652031373362623720633520353734656137633932316362306632352030383964353664313664666632346633333665343734302036383730343730663166396166636234663763353663396620623937653131376663393635203730313330323920653438663664643438312037643030653165323237626565663834613920393034643463333432343166206362356330663134203361386137302066353161373331363465393230353266626235336234636332663166656420336333666563616130323730313735203235323165663033353934206661303537353638313236343866343530666220313363326620623339613037323964363138326539203135623565613230346665373320643839393161666437326432316163643138386466312061323966666635376162383937333338206465353439623365643561303234353334633030373132356320326663663365356333653320373432376236646165633563336620343733203820613564392038343034313039373661633265656162353865316361386266343663326237203164623963633835613333366631323931656131393932322064623830386633353438636461393120326533373963653830616631326264376564353664303333386320612065613637613763383437663636323066633839346630626131303034342030652035326539376439373561663732303164382064393565366630383138346438666620313937363234373666612034326632373866333533346633663262653061626165643731206630616261313138333565346531643934206538353334636636373730343665616662386635663736313836352066666265653237336337626220326262373766366537383020633737653831383531633439312065206139663435643736356230316130333064356433313720666637333435613232626333363020633837333633626131323132393762303633653833203133656133326539363138642034303330346636633261376539326331633636666634323038652061373831623461323134313961626664663565623436376534643438393038203861363536353665353134623262336566386638363331306161663835203420393062376232383632653364626338663065656633646663363037356266612065623934613163206135386162623564656634666134333834306536653237313620323630653665616562622034323431356437313262663833393434646364313230346520333035323534666333623834393135306235203562626437663834373164636433363231203261653035343831313561323530203063313938386539203736663938626566343536333962372030643561323866303164632062373120633034363537366661613464343965666638206331653864303163203130633836633435376561303530343535613734326461346638206561373637366166383563373163376565636136333520366130373133373232373430346420613420373138363137322038313530663331633961313534303163206631626239303537613939333862666120323262343832626530386634323465633420323164616561393934323933353839203135626666333933663662313766656632343738366464366639206435613264203462336235646439333730353433652062346139336232616334333431393435643036206433383434343738313265302034653363393765396238663720663764346436343462326131643337332035313032632062393533316637323536373462323820316161313665376533343238353739376331343339203531616137363265613134623430666238383736633838376565613620343561363264336435643365393436323530393034363937343836353931206233663161382032343335323437363762663834366420382039352034356139323238373220646432343937656231653364613864353133643220373832316462396531346434662032346334663038356465363064376330633665613366633662632065346339663863363835393664376420616664366338636230663235313662383766323462626438203631643265343537633730393439206432643336326364633635372033363035663964323766643664373220333264653931643636666535626635333735333020383539653161303862363520396235613535662034313136636461396664646562383433393634303032206538316633623263306361353636616433646262633665323334203064336231643534203130633434306265356330626361393520376461643834316620613631663034313936373937326538303563636665653535632064656565396363313665393261623139372037363237353534303733633166353662396520323162656263626664326532323832663834203762313231613833656562393164623862646138316261383863363334623436333934203539383835656263373337363137616464616166306362383039"]+ + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "bincol"], + + "columntypes": ["int4", "float8", "bytea"], + + "columnvalues": [1, 0.230543947778642, "0420019803930402045901000170038901410282024303210187026304890472032803710073031500080127007204210082021000680057052701150272044603260158034002800265052201570416028404170217048401540192044105030038052102890047010603670493019400360011025500350133054505070479015003050212043102910380030300220250053405340415016404260370020503990096025605130484019301340524020604040564034803890509026105500237048604090546028901300572055500890533038802620377017104790188027401390115017003430257010505610064007803080474061405840428024004710232018501470369015500970465008005050105047600480609003403350113015505150474042506280416049500610088034000510046013403040540037804990034010506640136059300840667003605830049000306210400012201100265061905570244037603950309047000680364052002090684039806060517043600250520058006450610058106860521063406910469035101160587062900550461017604480163050002270235016600530455016104690369070202030396052200820343043206890330024606210319000202540441061501730500035803580227053001360464003103100521050504790261013904590474055202490561015307000521049801960407006702000673052700720086027904450459051602240602022402560148076800030647026001480343075307230603055200960542030406140749072806860162063304380238072507300702040104640131022106990398037606880403023701470558059401140493040306870595014601830411010001140298026907730754051706960682041402800330055105100217012700610091054603070244028000770362079304960226056106500416013407560536044401790480036707150340021102820632055408550294078101190358000506850678025701010760063400430396087006250186041907670083008803400269058507220118004600480410070006210398010705310522047805380328027608060433015405550479056405440214075900640091084801560443020807620268033008120319075506120034023907250583078002880207018505740103063307350677018903780298041002190365050501470528001403620364029107040249062205290882065907780671030006230006051508160599062305030389035206990781066101490032006206710184060706880558000100060301025806480848017903380662087306490312088101860157050308290676090601920396071008740551074509410235093705580946050105610954081308290606067010160956033208950604065407800797081802710623048601720823089509040689042806360621067205610155060400340733054308730540011805150537005108580406067304780152043702620432001907630610086606210477051010640063008006870641023902360678099507950499047409191031102809750832036205830238052010350509096610570201050208550841099302830838106103660444061906130688021105300399072610180234067509640122041702220723066307580668006606300634027300210388001010430680087210041057019605080554090407271100017703341007041810290856054503131087014109960717082810660212032601930235072502040147026411000016018701400539075710690118071900830461058205130344028710740667022500410510096208910422118300420621023907870833039010600772040800600917096208370818108503760904035809740228071300650123019002950165071400701080114900681126057103130716020607140583099811340646071408960277032507800663002111490429025406460496038108430801055103340875041402670947032208540020105710670753040308380662106603150323009206491123077206711039121409330436045700560030000606200373090310470648059701000244062011840056010803150915078701201239111902140615097910060009075009550965119801251025123201320358031210580124097703630227122909980127128911120449091206020573086304280794017201080501018208760152117007750281089007050417125910260163005106890535028406070215041405830007087501700623011410541063092612321175008500640716024112620149052808130871095607370556112507911263030410830514052501341112053310301288117211480987087807140865069608030933004110510834019302010273108411791027025709330438014812460143067403800281040509261334031307151099132302010417079409131239033009570894118411571101004108420881109111070407011012600248025705160636054409310145046912530876015011641083057705310571039408690099130906281281098206710687042603270359084304400184109707030712028212610196043102720004132704261193096010150259006614201148016712770308147607970993069312341330106106050289125202311008048505200798068609611077069108140009040502891046067003570987033105290779064605210077014312291336150107930433027505480670130410441202059102150653015809211485016813360245123504820610070308211150149914820137003200821392139500620651028603421211097001150719063807180940130608810316125810540112151007460604056314641443016314201381030314551467014212991533080600070299045609960416119000581149055813900455088210781530099810200693001415970583148501590425128804680300117606140011112714370019143302861035024015001096141204480890025213480363018407381404089107531400148706331565028503080405059115061032060410120852062408271145003010731023114708601482040011191200077013080293054005551061030304060041023006970354064413010217002202431249089008790415037709111509142103960703124708040156078315911489108304510364047107610778051409971489087616541113109816791363066508810551108912661480091410010171163205560990007513540891159107361352024012170402103200141417081909051371022002901347160809680507043103370055019512681075037011851643137912631273053611320270015813781510056706711526025015060688164517320984125216040202000002740545005604740062115008511268104504750774056010220143083611851546058617640441034902290181104901090148025613831780046213850260101714450743108208101610056500640285135406341325150214850716125902640691171006200925007316891037022401240617020505930195047016291664122708960653102714720720131910091365082406921031155401251302040800120081135000861799055003140068117805240672137810030465120703851377000414301005073609010158025017410862129914450990074418621004082713531093077100271415084112250057152607341077010500651470150500691026062608180039078810731809166604871370076412431352178601710814098309550842050318120166056214420913165715510980122511521052033817911885037806581041028004131538167311910860110610621036193401150059084306261900101411981412194309271032098202140243009105570099004109430768109912281189069209570427156701071507064500941626070509510283065319821501010319720457115109830675140010771242150211200205028602391452149409420424193005300533145711860630110119041597139005561598090006611585136618310564003212321658129307340771150310251015094905121973138104380479192419171684052709971578010603660100172912810771129206200581186606531833149819670523022514371565125603400024119717430469168516310347132700971359085802051733096119600957174511941588025510080168003104440078056206731536006119481884008510711560056106851118091420331218019208031428195117791312081614430415031717041438048817381890056801910455000702530310191903401398137709102095038418392030162020360713093518820381012905731846055008951433200913911051178219691247009519791506041017731853182910150620179814060325169608870226025618382135064319710548034403581457179902210693069020290511195621280336130203622135099600300979162618540214195813831114219016450781215900990580051604480944199500681169049207671018101105400965135318601334130306551367007800841027029520700206142520661874221920291977057903220200153701090269048606081047152016341596025607631238160920851904074721671992178902151838200016601677164416521476138822411804159315361917186820310266066113021922000615640422126109190257091316780173065112100390022909532073193003311459113617391439067110600700031706560460058713271780023213351061066003071995092212331386109818950300149521291266127917681603043805991044189712802119028116040457074822011803021901040822129507731134097817080043004104791963034519941776162909431219090313881828196209560770175412430036221920022266168422260008015211730791130221660150134722100635096201850279038418361235161903700259108823581228187017490099190916072127181409211989182410760781022823970574038013610408102523370596130803190046014919600421041106480393165601242165175820581373149114732308108008950972187311260969002315132348043701162280104114410165108915942150151620130363191612440489166005740121059920841613048007230062146501591203244801820272236206250390220616801850237603120993208118470555245113111815046805112398059211192026222616060271229206000432102005850617129704811251169302150452106701180768207322250133013022011460196801651980188507650598142105022225169703020313213613350906023801231395150418371614196403871735020924861453034400821143182220741311128514402087189203320048159720500354191616601706027919031832169108681133076502941525252305061477142808551561001601281089134314292548088007670307093023842382129017421481043120270820228611511699084319271998238818862513128707350781026707520912137021122359134303970529165613400331145500322094033904691529117001630075026910162025229108071309220921102054037023830184129311372322104424970087158115341443191703651477139207081953029218932120036821670496241718311313108614090790050417850539069104301690037414871549046304170431192323570800074410911517004113880753218617610262000615222115133426220853213504432659268311430402169815221907056619912331100212352014181319880412064120331816140315330886166915412427109201732362195623330090192423241246233313160058153418902072116101720588046320062600088026561918271813350727087202792286057913842464021806122073030925581670157021620243163009552155096421302332156026001595142207231511059106990089132615810371086121691771057223922391266927072195157415101595182103682562121013441924077301251758238615632491111421620396120506991995158215711380056321510987016720380909238608132437118126552812095010571348007018401477184814240228153625522414193809380287111925381875251602671209067204360425159200011247120811951081119921572151256322301155120012402596143127942315100818900398129901540094032526970364154805050806197921150808036104572017145416691314074413750682191225901936164611461869109321660884149605821040159209110865196224771376277915710606068819381068272704962756114212481231183302630929087019272088275901071352072716191942177902982865265522822436111121541087172428520105280526680607264808781869094627312136188606601131104304931240241112282878141500660219134827492525084409071735194326501648205225141370266722162259157901942040075721002709190101700223016926061464008610461532030724101316285802662233161522301912027813011449166309900681093825870877300003413000272522630157295224352791141325240827296328370237126826990506049613022760242815851043085802292044154611761618243411651965242208731205258408070617235522360115013921762981037804012652089009030909061602922510167011592744066727220864230221112042121414842926243310170664305903142923009404552038001808372446269717370268052523610563306109521735273616271385051008510415257320781914242314292943309614080151293815040610188315241456123511290090150716602474207716260310070212611954210217772816252212421781132005510086115305371508130603603028192422611421024603592562033718811086283608242729315215330844196704942639164730420729027912091286036623751830188905222194177224651301002827161665261630590381052927391214009627342763094715300071041831953143115502811167245506510364110025590891011011420172142411712914310706002791027911342340150412321882107421890205114626140204109205530488227230321145264109110494030610241647048024622831018023570194299726401339211409122584076419961543097231550926117910021486167300351285283027012207006430123242172702292459131304101565151101590954286422941876219330670609046707650507140219561520290303551556091032120988313832800731311417250962229630531377057212731540153608550545011930700328073302281101124616443077278112540115103021740031202920160013276818301754040908141502180013932788001629440313056730670068089804640298201017221958176711783226188422192067191709110744193203452591034107580051185725751456130425941058162131690780169107021249199427322988059111350797046330383037255015870570330301470919252804911685258223660887065502840105172319213303251202230608036622363365338228351101077533050752042324632354099923782505192715073003020206871965109813482254120530880760110421890986171925613243167525342663278833172554010202991593247713070541155432532062112900032757311311100659192823270311269634442520022517121636002734040721271427450593181728500896342518712216049134412014257310962019186807483141253426941998285019211977189721500206004921790137077614142907137532482275228031960653100401800610303727761717155811432473120601771670322230520082169114402251190014900919204022742346143701262086019424261769085334411952146929621206320209862360214822032540027918992065036200473519263419641462356304590191236519080318090121052766268729672665108208742077230005253072110026921713007829750043216133430091212124112072000324112536019612010864051721112989330712192379239223113263088010230184036721332899209622142286214107762040223429160850070229213283326131210868050500142999352033500595228621282927194030180320212733912472140818611059006703721843212526261132298433360423264129693570351934813588288333703304348620121785277203001159309724460905191701932783298702613161116624032128230817301808273607061115264905640935257634720640221432932669031823912974148718121740240100411935150130532200097905190912312628472657123518913372236008430221330534413723022719503318291822722001218800400096020924610137216102383215063912253741156006332869049318781029014305091879036700881596036503173563371132602096196917052138206819180854220703291094168009742329168025472969079730471086183531941601373135661691155701502011136201021508347620873229183903781368270126031701000504972684235421911448154229960712263910370121044109853716214625560052035701110154187836162259130916472641269005421438057505481940328229210315090706403336162633000542174937481536165120670266170424280378186104700169028417911829294706442377053812252931249406692012281415852659230832252116285711172020053127820228079906222676118024983152135127861073319618701723170424132959076610343636279538711337157723000687371112771814184418130711207526201339086238123858012512612752120705650719294422833152200530570271174519480245309435392563379033483853168512721745240333650447375402940345370004201617252916372187325606540537248226753618275704781626300635971232162834550642154611891925330736121346375934251643013531802068176517533719397110530398053135553094019123483578183013883214307330302704372205943904166639273545302437152996067838542196276216273964250216181015290421540583200823492950159501740329081232713383353729983984344506493913298836973625197403463475015131301077010416122708112804940835171625183203064000763380097208952624032504031588028138752243016128261906381507522257325209041343026810102968299821473468384138781929299104442007231714232910087617523318247720363133064722001889256919502648074611293561210014000478098703162642037500792442231930932891022913160213316121991978238705774031142412302127332938194094187104441104132925602515181235572835033839382917279821361894157023693220178614081291378038151873369210993113168302982806165121833255276435241674113611861093399315280892276501773045050217591258374635592678087031902342275827293451171102413754035119041766363104981124112616422320222814683861312800544042199505591612326401270991175510044205411637832743338112932987294716480687050610851189163922202845397702380097363933890151348011670715087002190843186919881855186418931423038310542727339340230139408802831231103519353468390116843710400110902865415703324043061412094267146330922001333306993909049410850696324102250468338300600754034111032703383507450112328504851210188003781546165709962765165724711581367315272286330820253381401109813609017400773673093304210470365742831220377232741709067108452091222925153096068741851256227935552795024825530499365422561487295024321566230733741991278227111957401321620904138428391756349207294290225414214147352037173366197239701573247632843846397618851925118242100949318826373680078122991478169236954338346228270687339507092118318242551469218018481072376543434379324039481878077707361713173339474370103003252276251920291584247311000014316601000728088033050590236010762451344104402397342237031942088200522685260817972222257028362552042109300152201734211260203321621361276830490236336409721319137744381763379134251030128543151083399024762893176005951279433110202216001130521185127906213362265034081951288923122931422036992912150730271870254543241720363738464215205311200315334209771342106909884416226322770533113804343965310433441779153930760985447200734034183426363864356717713209328338394339360326720791042037511786032814924080086426394520031212193342210327701891309627221967260600150066194036071849061323541154041914183845121518433056301521744560255330452646253033623875131809032086322440210245062220620261068840173892255000461672371304683102299116920361147101282549146126981013412606414398342219680700091306030135116112292211142419221637072444911684240836082156090619943861127034763992383703162077022444692723001432780067071941990674085607261911308221603848008328903719177906622698395115750049318128543548254020553868463322823702270922982334277830231890345838872622070723140120458123993030364441913699167734830598172719973471060845560848450145263146353325570761118406533805308841343014102301400636114400403051419537092556320506821346380924213357258330343221343928413052188016700897264828641555174512390981004322691123068334231165375429040153158313840840293904693277156830691579005617774439312736711363403215764247083633340730182533803015295640691690413030764614428746721232035728531704365544320011046244911800014228530706151521212293099629640854173100054256476729803552166823351846150718451741274822054614446510724264447815383970147416822023218532074159449442122319053011292326481410960494355927762845058342944704233622222085213918743165158715364715073530211561277203704790210600394175444205720455192505551558242341384353042247273810028722111177238543653064069710894612056518302775213646203149207318583190138914413768184833794329341709263600290513513462184116410788302740420277120847461374094204093216373525582954199346464826028711291359407929904760351515070770221444312130077013563782156344032918184406852760322716333173152404510806449824570536440927471673083019034683066704871247144227150748358634922113243301041581040619592272318302383917140617724373221813241872275907834638444416191573417622912064044737444797120023653323332748153429492002300406221134330646"]+ } - ] + + ] + } - { + + { + "change": [ - { + - "kind": "update", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "rand1"], + - "columntypes": ["int4", "float8"], + - "columnvalues": [1, 123.456], + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1"], + + "columntypes": ["int4", "float8"], + + "columnvalues": [1, 123.456], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + } - ] + + ] + } - { + + { + "change": [ - { + - "kind": "delete", + - "schema": "public", + - "table": "xpto", + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + } - ] + + ] + } (9 rows) diff --git a/sql/bytea.sql b/sql/bytea.sql index 9c6ed9df3b1c..f5ffddb0ee55 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -12,7 +12,7 @@ bincol bytea SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); -INSERT INTO xpto (bincol) VALUES('2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809 2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb4ae7 06ec46c55611a466eb7e3edcc009ca6 e 5ed9cd0ea5a4e55d601027c56a 64cacf3a42afc 90e63000c34506993345355640 79bce 173bb7 c5 574ea7c921cb0f25 089d56d16dff24f336e4740 6870470f1f9afcb4f7c56c9f b97e117fc965 7013029 e48f6dd481 7d00e1e227beef84a9 904d4c34241f cb5c0f14 3a8a70 f51a73164e92052fbb53b4cc2f1fed 3c3fecaa0270175 2521ef03594 fa05756812648f450fb 13c2f b39a0729d6182e9 15b5ea204fe73 d8991afd72d21acd188df1 a29fff57ab897338 de549b3ed5a024534c007125c 2fcf3e5c3e3 7427b6daec5c3f 473 8 a5d9 840410976ac2eeab58e1ca8bf46c2b7 1db9cc85a336f1291ea19922 db808f3548cda91 2e379ce80af12bd7ed56d0338c a ea67a7c847f6620fc894f0ba10044 0e 52e97d975af7201d8 d95e6f08184d8ff 19762476fa 42f278f3534f3f2be0abaed71 f0aba11835e4e1d94 e8534cf677046eafb8f5f761865 ffbee273c7bb 2bb77f6e780 c77e81851c491 e a9f45d765b01a030d5d317 ff7345a22bc360 c87363ba121297b063e83 13ea32e9618d 40304f6c2a7e92c1c66ff4208e a781b4a21419abfdf5eb467e4d48908 8a65656e514b2b3ef8f86310aaf85 4 90b7b2862e3dbc8f0eef3dfc6075bfa eb94a1c a58abb5def4fa43840e6e2716 260e6eaebb 42415d712bf83944dcd1204e 305254fc3b849150b5 5bbd7f8471dcd3621 2ae0548115a250 0c1988e9 76f98bef45639b7 0d5a28f01dc b71 c046576faa4d49eff8 c1e8d01c 10c86c457ea050455a742da4f8 ea7676af85c71c7eeca635 6a07137227404d a4 7186172 8150f31c9a15401c f1bb9057a9938bfa 22b482be08f424ec4 21daea994293589 15bff393f6b17fef24786dd6f9 d5a2d 4b3b5dd9370543e b4a93b2ac4341945d06 d384447812e0 4e3c97e9b8f7 f7d4d644b2a1d373 5102c b9531f725674b28 1aa16e7e34285797c1439 51aa762ea14b40fb8876c887eea6 45a62d3d5d3e946250904697486591 b3f1a8 243524767bf846d 8 95 45a922872 dd2497eb1e3da8d513d2 7821db9e14d4f 24c4f085de60d7c0c6ea3fc6bc e4c9f8c68596d7d afd6c8cb0f2516b87f24bbd8 61d2e457c70949 d2d362cdc657 3605f9d27fd6d72 32de91d66fe5bf537530 859e1a08b65 9b5a55f 4116cda9fddeb843964002 e81f3b2c0ca566ad3dbbc6e234 0d3b1d54 10c440be5c0bca95 7dad841f a61f041967972e805ccfee55c deee9cc16e92ab197 7627554073c1f56b9e 21bebcbfd2e2282f84 7b121a83eeb91db8bda81ba88c634b46394 59885ebc737617addaaf0cb809'); +INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; From 1ec32ff248e48d2609081acf0d5354cc2575ad4b Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Mon, 10 Mar 2014 12:43:22 -0300 Subject: [PATCH 005/154] In commit ea177a3ba7a7901f6467eadb0a407e03d46462fd, the internal structure was changed. --- wal2json.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/wal2json.c b/wal2json.c index 7786b498daa3..e5dc6727896b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -527,7 +527,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: - if (change->tp.newtuple == NULL) + if (change->data.tp.newtuple == NULL) { elog(WARNING, "no tuple data for INSERT in table \"%s\"", NameStr(class_form->relname)); return; @@ -546,7 +546,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, return; } - if (change->tp.newtuple == NULL) + if (change->data.tp.newtuple == NULL) { elog(WARNING, "no tuple data for UPDATE in table \"%s\"", NameStr(class_form->relname)); return; @@ -565,12 +565,14 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, return; } - if (change->tp.oldtuple == NULL) + if (change->data.tp.oldtuple == NULL) { elog(WARNING, "no tuple data for DELETE in table \"%s\"", NameStr(class_form->relname)); return; } break; + default: + Assert(false); } /* Change counter */ @@ -594,6 +596,8 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, case REORDER_BUFFER_CHANGE_DELETE: appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"delete\",\n"); break; + default: + Assert(false); } /* Print table name (possibly) qualified */ @@ -605,11 +609,11 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { case REORDER_BUFFER_CHANGE_INSERT: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, false); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false); break; case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, true); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true); /* * The old tuple is available when: @@ -620,7 +624,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, * FIXME if old tuple is not available we must get only the indexed * columns (the whole tuple is printed). */ - if (change->tp.oldtuple == NULL) + if (change->data.tp.oldtuple == NULL) { elog(DEBUG1, "old tuple is null"); @@ -628,18 +632,18 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (indexrel != NULL) { indexdesc = RelationGetDescr(indexrel); - identity_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, indexdesc); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, indexdesc); RelationClose(indexrel); } else { - identity_to_stringinfo(ctx, tupdesc, &change->tp.newtuple->tuple, NULL); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, NULL); } } else { elog(DEBUG1, "old tuple is not null"); - identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, NULL); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, NULL); } break; case REORDER_BUFFER_CHANGE_DELETE: @@ -648,19 +652,21 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (indexrel != NULL) { indexdesc = RelationGetDescr(indexrel); - identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, indexdesc); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, indexdesc); RelationClose(indexrel); } else { - identity_to_stringinfo(ctx, tupdesc, &change->tp.oldtuple->tuple, NULL); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, NULL); } - if (change->tp.oldtuple == NULL) + if (change->data.tp.oldtuple == NULL) elog(DEBUG1, "old tuple is null"); else elog(DEBUG1, "old tuple is not null"); break; + default: + Assert(false); } appendStringInfoString(ctx->out, "\t\t}"); From 032f5d4a932e12066bdca9e92008540cbb66999d Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Mon, 10 Mar 2014 12:47:13 -0300 Subject: [PATCH 006/154] Unbreak regression tests. --- expected/bytea.out | 6 +++--- expected/delete1.out | 8 ++++---- expected/delete2.out | 10 +++++----- expected/delete3.out | 4 ++-- expected/delete4.out | 4 ++-- expected/insert1.out | 6 +++--- expected/savepoint.out | 4 ++-- expected/specialvalue.out | 4 ++-- expected/toast.out | 10 +++++----- expected/update1.out | 8 ++++---- expected/update2.out | 10 +++++----- expected/update3.out | 4 ++-- expected/update4.out | 4 ++-- sql/bytea.sql | 4 ++-- sql/delete1.sql | 4 ++-- sql/delete2.sql | 4 ++-- sql/delete3.sql | 4 ++-- sql/delete4.sql | 4 ++-- sql/insert1.sql | 6 +++--- sql/savepoint.sql | 4 ++-- sql/specialvalue.sql | 4 ++-- sql/toast.sql | 4 ++-- sql/update1.sql | 4 ++-- sql/update2.sql | 4 ++-- sql/update3.sql | 4 ++-- sql/update4.sql | 4 ++-- 26 files changed, 68 insertions(+), 68 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 3ba639ce8163..fc45d1abca4f 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -12,7 +12,7 @@ id serial primary key, rand1 float8 DEFAULT random(), bincol bytea ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -21,9 +21,9 @@ SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2j INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: column "bincol" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/180CA18 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/181BB48 data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + diff --git a/expected/delete1.out b/expected/delete1.out index c7a2f44adf63..e7ad986935ac 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -63,7 +63,7 @@ UNIQUE(g, n) INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -75,11 +75,11 @@ DELETE FROM table_without_pk WHERE b = 1; DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1781EE8 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1793540 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1782018 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1793658 data ----------------------------------------------------------------------- { + diff --git a/expected/delete2.out b/expected/delete2.out index cfdf4b1d1859..1125b1b718f3 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -63,7 +63,7 @@ UNIQUE(g, n) INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -79,13 +79,13 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A9528 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B8728 WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A99B8 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B8BB8 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17A9E48 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B9048 data --------------------- { + diff --git a/expected/delete3.out b/expected/delete3.out index 001dc12f31f0..8d60e119391b 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -64,7 +64,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -81,7 +81,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/delete4.out b/expected/delete4.out index a278aa8fdd3c..2d293dbf827c 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -23,7 +23,7 @@ UNIQUE(g, n) -- INSERT INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -34,7 +34,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data ----------------------------------------------------------------- { + diff --git a/expected/insert1.out b/expected/insert1.out index 49bbec0843c4..c10aafd3006f 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -1,5 +1,5 @@ -- this is the first test (CREATE EXTENSION, no DROP TABLE) -CREATE EXTENSION test_decoding; +LOAD 'test_decoding'; -- predictability SET synchronous_commit = on; CREATE TABLE table_with_pk ( @@ -58,7 +58,7 @@ o json, p tsvector, UNIQUE(g, n) ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -70,7 +70,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/savepoint.out b/expected/savepoint.out index 821a7e82a529..46fd9b6ba80c 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -1,7 +1,7 @@ -- predictability SET synchronous_commit = on; CREATE TABLE xpto (a SERIAL PRIMARY KEY, b text); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -22,7 +22,7 @@ ROLLBACK TO SAVEPOINT sp2; RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data ---------------------------------------------------------- { + diff --git a/expected/specialvalue.out b/expected/specialvalue.out index 4f84baed97d7..0c1098efc48d 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -1,7 +1,7 @@ -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS xpto; -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -16,7 +16,7 @@ INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data -------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/toast.out b/expected/toast.out index 01d7d1becdd9..80e7a4a7c3d1 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -14,7 +14,7 @@ rand1 float8 DEFAULT random(), toasted_col2 text, rand2 float8 DEFAULT random() ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -28,13 +28,13 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: column "toasted_col2" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FED90 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DF00 WARNING: column "toasted_col1" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FEE60 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DFD0 WARNING: column "toasted_col2" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17FEE60 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DFD0 data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update1.out b/expected/update1.out index cacebc0775a3..5fe76c564dae 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -63,7 +63,7 @@ UNIQUE(g, n) INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -77,11 +77,11 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1700320 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/170E8E8 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17006D8 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/170ECA0 data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update2.out b/expected/update2.out index 6451ae5b7888..4ec9c05e6729 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -63,7 +63,7 @@ UNIQUE(g, n) INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -79,13 +79,13 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1725E70 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734538 WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/17263B0 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734A60 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json" during the pg_decode_change callback, associated LSN 0/1726918 +CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734FC8 data --------------------- { + diff --git a/expected/update3.out b/expected/update3.out index 37005e57e5bf..d17e253362ac 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -63,7 +63,7 @@ UNIQUE(g, n) INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -79,7 +79,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update4.out b/expected/update4.out index eacceaecdb6a..d60769dab20c 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -23,7 +23,7 @@ UNIQUE(g, n) -- INSERT INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- init @@ -35,7 +35,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/sql/bytea.sql b/sql/bytea.sql index f5ffddb0ee55..5e845522d12c 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -10,11 +10,11 @@ rand1 float8 DEFAULT random(), bincol bytea ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete1.sql b/sql/delete1.sql index 3887d569d946..6e10c23e6c00 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -69,7 +69,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- DELETE: no pk DELETE FROM table_without_pk WHERE b = 1; @@ -80,5 +80,5 @@ DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql index 585c46cab80f..82d05b9a5a76 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -69,7 +69,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- DELETE: REPLICA IDENTITY NOTHING ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; @@ -84,5 +84,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql index 981713e62e2a..7b733f624c64 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -70,7 +70,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- DELETE: REPLICA IDENTITY FULL ALTER TABLE table_with_pk REPLICA IDENTITY FULL; @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql index e42e6ba14d1b..5aa2146344f9 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -27,7 +27,7 @@ UNIQUE(g, n) INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- DELETE: REPLICA IDENTITY INDEX ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; @@ -35,5 +35,5 @@ DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql index f65f4350415d..2af4858afa2b 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -1,5 +1,5 @@ -- this is the first test (CREATE EXTENSION, no DROP TABLE) -CREATE EXTENSION test_decoding; +LOAD 'test_decoding'; -- predictability SET synchronous_commit = on; @@ -62,7 +62,7 @@ p tsvector, UNIQUE(g, n) ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- INSERT BEGIN; @@ -71,5 +71,5 @@ INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUE INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql index 13dc1780d3e2..6140a5b058da 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -3,7 +3,7 @@ SET synchronous_commit = on; CREATE TABLE xpto (a SERIAL PRIMARY KEY, b text); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); INSERT INTO xpto (b) VALUES('john'); INSERT INTO xpto (b) VALUES('smith'); @@ -22,5 +22,5 @@ RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index 00a4986c3d12..dfa2a0434aac 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -3,7 +3,7 @@ SET synchronous_commit = on; DROP TABLE IF EXISTS xpto; -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); CREATE TABLE xpto (a SERIAL PRIMARY KEY, b bool, c varchar(60), d real); COMMIT; @@ -15,5 +15,5 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index dcf447a6c69e..b5a5ed532e8e 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -12,7 +12,7 @@ toasted_col2 text, rand2 float8 DEFAULT random() ); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- uncompressed external toast data INSERT INTO xpto (toasted_col1, toasted_col2) SELECT string_agg(g.i::text, ''), string_agg((g.i*2)::text, '') FROM generate_series(1, 2000) g(i); @@ -27,5 +27,5 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql index 76664ab8802c..c86f931faf75 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -69,7 +69,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- UPDATE: no pk UPDATE table_without_pk SET f = -f WHERE b = 1; @@ -83,5 +83,5 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql index 0db94e55dda6..83a8f317bd8c 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -69,7 +69,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- UPDATE: REPLICA IDENTITY NOTHING ALTER TABLE table_with_pk REPLICA IDENTITY NOTHING; @@ -84,5 +84,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql index ac58cc013a93..306e81909024 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -69,7 +69,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- UPDATE: REPLICA IDENTITY FULL ALTER TABLE table_with_pk REPLICA IDENTITY FULL; @@ -84,5 +84,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql index e4c683349430..d22baf48d5d9 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -27,7 +27,7 @@ UNIQUE(g, n) INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', false, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(4, 5, 6, 3.54, 876.563452345, 4.56, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); -SELECT 'init' FROM pg_create_decoding_replication_slot('regression_slot', 'wal2json'); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- UPDATE: REPLICA IDENTITY USING INDEX ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n_key; @@ -36,5 +36,5 @@ UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_decoding_slot_get_changes('regression_slot', 'now', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); From e0a518c6cc3c3d2066a5c4d8317dd670c8f82b5b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 7 Apr 2015 23:04:55 -0300 Subject: [PATCH 007/154] Remove contrib dependency. The old Makefile relies heavily on been in the contrib tree. While analysing the ethansf pull request, I realized that that premise does not hold water because you could build it without a source code tree. Although I didn't have used his patch [1], this code was inspired on it. [1] https://github.com/eulerto/wal2json/pull/1 --- Makefile | 61 +++++++++++--------------------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index a6a5903c2711..e26a32d5e2f7 100644 --- a/Makefile +++ b/Makefile @@ -1,55 +1,18 @@ -# contrib/wal2json/Makefile +MODULES = wal2json -MODULE_big = wal2json -OBJS = wal2json.o +REGRESS = insert1 update1 update2 update3 update4 delete1 delete2 \ + delete3 delete4 savepoint specialvalue toast bytea -# Note: because we don't tell the Makefile there are any regression tests, -# we have to clean those result files explicitly -EXTRA_CLEAN = -r $(pg_regress_clean_files) - -ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) -else -subdir = contrib/wal2json -top_builddir = ../.. -include $(top_builddir)/src/Makefile.global -include $(top_srcdir)/contrib/contrib-global.mk -endif - -# Disabled because these tests require "wal_level=logical", which -# typical installcheck users do not have (e.g. buildfarm clients). -installcheck:; - -# But it can nonetheless be very helpful to run tests on preexisting -# installation, allow to do so, but only if requested explicitly. -installcheck-force: regresscheck-install-force - -check: regresscheck - -submake-regress: - $(MAKE) -C $(top_builddir)/src/test/regress all - -submake-test_decoding: - $(MAKE) -C $(top_builddir)/contrib/test_decoding - -REGRESSCHECKS=insert1 update1 update2 update3 update4 delete1 delete2 delete3 delete4 \ - savepoint specialvalue toast bytea - -regresscheck: all | submake-regress submake-test_decoding - $(pg_regress_check) \ - --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf \ - --temp-install=./tmp_check \ - --extra-install=contrib/wal2json \ - --extra-install=contrib/test_decoding \ - $(REGRESSCHECKS) - -regresscheck-install-force: | submake-regress submake-test_decoding - $(pg_regress_installcheck) \ - --extra-install=contrib/wal2json \ - --extra-install=contrib/test_decoding \ - $(REGRESSCHECKS) -PHONY: check submake-regress submake-test_decoding \ - regresscheck regresscheck-install-force +# make installcheck +# +# It can be run but you need to add the following parameters to +# postgresql.conf: +# +# wal_level = logical +# max_replication_slots = 4 +# +# Also, you should start the server before executing it. From cfdbe0de87c66d49763da2ff84ee7a1c59131e81 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 7 Apr 2015 23:23:57 -0300 Subject: [PATCH 008/154] Fix regression tests. The regression tests was very unstable. The main reason is the associated LSN in some CONTEXT messages. Adding VERBOSITY setting to supress those CONTEXT messages. --- expected/bytea.out | 2 +- expected/delete1.out | 3 +-- expected/delete2.out | 4 +--- expected/delete3.out | 1 + expected/delete4.out | 1 + expected/insert1.out | 1 + expected/savepoint.out | 1 + expected/specialvalue.out | 1 + expected/toast.out | 4 +--- expected/update1.out | 3 +-- expected/update2.out | 4 +--- expected/update3.out | 1 + expected/update4.out | 1 + sql/bytea.sql | 2 ++ sql/delete1.sql | 2 ++ sql/delete2.sql | 2 ++ sql/delete3.sql | 2 ++ sql/delete4.sql | 2 ++ sql/insert1.sql | 3 +++ sql/savepoint.sql | 2 ++ sql/specialvalue.sql | 2 ++ sql/toast.sql | 2 ++ sql/update1.sql | 2 ++ sql/update2.sql | 2 ++ sql/update3.sql | 2 ++ sql/update4.sql | 2 ++ 26 files changed, 40 insertions(+), 14 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index fc45d1abca4f..2af27d54ec82 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS xpto; @@ -23,7 +24,6 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: column "bincol" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/181BB48 data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + diff --git a/expected/delete1.out b/expected/delete1.out index e7ad986935ac..40925f6bb5fd 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; @@ -77,9 +78,7 @@ DELETE FROM table_with_pk WHERE b = 1; DELETE FROM table_with_unique WHERE b = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1793540 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1793658 data ----------------------------------------------------------------------- { + diff --git a/expected/delete2.out b/expected/delete2.out index 1125b1b718f3..381feba61264 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; @@ -81,11 +82,8 @@ DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B8728 WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B8BB8 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/17B9048 data --------------------- { + diff --git a/expected/delete3.out b/expected/delete3.out index 8d60e119391b..90cd63c23194 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; diff --git a/expected/delete4.out b/expected/delete4.out index 2d293dbf827c..2ec6449dade3 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_unique; diff --git a/expected/insert1.out b/expected/insert1.out index c10aafd3006f..df4d61634d04 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -1,5 +1,6 @@ -- this is the first test (CREATE EXTENSION, no DROP TABLE) LOAD 'test_decoding'; +\set VERBOSITY terse -- predictability SET synchronous_commit = on; CREATE TABLE table_with_pk ( diff --git a/expected/savepoint.out b/expected/savepoint.out index 46fd9b6ba80c..45922b42463a 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; CREATE TABLE xpto (a SERIAL PRIMARY KEY, b text); diff --git a/expected/specialvalue.out b/expected/specialvalue.out index 0c1098efc48d..dcabfba2d8c0 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS xpto; diff --git a/expected/toast.out b/expected/toast.out index 80e7a4a7c3d1..06375baa7670 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS xpto; @@ -30,11 +31,8 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: column "toasted_col2" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DF00 WARNING: column "toasted_col1" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DFD0 WARNING: column "toasted_col2" has an unchanged TOAST -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/180DFD0 data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update1.out b/expected/update1.out index 5fe76c564dae..3c7c3537f93e 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; @@ -79,9 +80,7 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; UPDATE table_with_unique SET n = false WHERE b = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/170E8E8 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/170ECA0 data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update2.out b/expected/update2.out index 4ec9c05e6729..fc34f0de33c8 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; @@ -81,11 +82,8 @@ UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734538 WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734A60 WARNING: table "table_with_unique" without primary key or replica identity is nothing -CONTEXT: slot "regression_slot", output plugin "wal2json", in the change callback, associated LSN 0/1734FC8 data --------------------- { + diff --git a/expected/update3.out b/expected/update3.out index d17e253362ac..9c21441b6e9a 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_pk; diff --git a/expected/update4.out b/expected/update4.out index d60769dab20c..9627806f4375 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -1,3 +1,4 @@ +\set VERBOSITY terse -- predictability SET synchronous_commit = on; DROP TABLE IF EXISTS table_with_unique; diff --git a/sql/bytea.sql b/sql/bytea.sql index 5e845522d12c..5b416580028d 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/delete1.sql b/sql/delete1.sql index 6e10c23e6c00..f7db6909f516 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/delete2.sql b/sql/delete2.sql index 82d05b9a5a76..987430d3dfb1 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/delete3.sql b/sql/delete3.sql index 7b733f624c64..881bf8f1f173 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/delete4.sql b/sql/delete4.sql index 5aa2146344f9..011ffddb644c 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/insert1.sql b/sql/insert1.sql index 2af4858afa2b..c1bc2441dd3b 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -1,5 +1,8 @@ -- this is the first test (CREATE EXTENSION, no DROP TABLE) LOAD 'test_decoding'; + +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/savepoint.sql b/sql/savepoint.sql index 6140a5b058da..51d237508320 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index dfa2a0434aac..46796ecd223a 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/toast.sql b/sql/toast.sql index b5a5ed532e8e..acb2c9b6f95c 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/update1.sql b/sql/update1.sql index c86f931faf75..ccf6788713b4 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/update2.sql b/sql/update2.sql index 83a8f317bd8c..049d55b8bae4 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/update3.sql b/sql/update3.sql index 306e81909024..47b98bb4fa73 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; diff --git a/sql/update4.sql b/sql/update4.sql index d22baf48d5d9..23cd282b6bac 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -1,3 +1,5 @@ +\set VERBOSITY terse + -- predictability SET synchronous_commit = on; From 543b08cb3afd8a37997ea07c02fa571250b32d98 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 8 Apr 2015 00:19:08 -0300 Subject: [PATCH 009/154] Update copyright. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 7bec80b9aebc..980bded54e78 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2014, Euler Taveira de Oliveira +Copyright (c) 2013-2015, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, From dc6e390ef43c737cdfc8895f4b33babd0d8e1bb4 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 9 Apr 2015 21:42:49 -0300 Subject: [PATCH 010/154] Include LSN position for the next transaction. This feature was discussed with @ethansf and is useful for tool that consumes WAL using pg_recvlogical and similar tools. The LSN is important to mark the apply progress. It stores the LSN pointing to the end of commit record + 1. Hence, if the consuming tool crashes while applying a transaction (JSON document), it can restart the pg_recvlogical streaming from the last saved LSN position. This is essential for such consuming tool to work properly. Although, I did not have used Ethans' patch, this piece of code is based on his idea. --- wal2json.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/wal2json.c b/wal2json.c index e5dc6727896b..930cbc92c205 100644 --- a/wal2json.c +++ b/wal2json.c @@ -26,6 +26,7 @@ #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/memutils.h" +#include "utils/pg_lsn.h" #include "utils/rel.h" #include "utils/relcache.h" #include "utils/syscache.h" @@ -44,6 +45,12 @@ typedef struct bool include_schemas; /* qualify tables */ bool include_types; /* include data types */ + /* + * LSN pointing to the end of commit record + 1 (txn->end_lsn) + * It is useful for tools that wants a position to restart from. + */ + bool include_lsn; /* include LSNs */ + uint64 nr_changes; /* # of passes in pg_decode_change() */ /* FIXME replace with txn->nentries */ } JsonDecodingData; @@ -94,6 +101,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_timestamp = false; data->include_schemas = true; data->include_types = true; + data->include_lsn = false; data->nr_changes = 0; @@ -160,6 +168,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-lsn") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-lsn argument is null"); + data->include_lsn = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_lsn)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else { elog(WARNING, "option %s = %s is unknown", @@ -194,6 +215,15 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->include_xids) appendStringInfo(ctx->out, "\t\"xid\": %u,\n", txn->xid); + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->end_lsn)); + + appendStringInfo(ctx->out, "\t\"next lsn\": \"%s\",\n", lsn_str); + + pfree(lsn_str); + } + if (data->include_timestamp) appendStringInfo(ctx->out, "\t\"timestamp\": \"%s\",\n", timestamptz_to_str(txn->commit_time)); From dec2ee2f636057b36e57603c1fe09bc09cdda401 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 10 Apr 2015 18:31:32 -0300 Subject: [PATCH 011/154] Rename "next lsn" JSON key. It is a comestic change because you can access values like: foo['next lsn'] The other form (foo.bar) is not possible because of the blank space. --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 930cbc92c205..b0e08e4596b3 100644 --- a/wal2json.c +++ b/wal2json.c @@ -219,7 +219,7 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->end_lsn)); - appendStringInfo(ctx->out, "\t\"next lsn\": \"%s\",\n", lsn_str); + appendStringInfo(ctx->out, "\t\"nextlsn\": \"%s\",\n", lsn_str); pfree(lsn_str); } From 9b96d3a3f1e0cd05692c93e904588452fb82b606 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 18 Aug 2015 16:15:37 -0300 Subject: [PATCH 012/154] Fix handling of nonexistant columns in old tuple versions. This fix was discoverd in bug #13470 and commit d47a1136e441cebe7ae7fe72d70eb8ce278d5cd6 fixes it. --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index b0e08e4596b3..6000400b01b2 100644 --- a/wal2json.c +++ b/wal2json.c @@ -399,7 +399,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu getTypeOutputInfo(typid, &typoutput, &typisvarlena); /* Get Datum from tuple */ - origval = fastgetattr(tuple, natt + 1, tupdesc, &isnull); + origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); /* Skip nulls iif printing key/identity */ if (isnull && replident) From f9446d13fd7ca78a55a85d9bad174a00d627a448 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 26 Aug 2015 16:29:12 -0300 Subject: [PATCH 013/154] pretty print option. The new parameter 'pretty-print' chooses between a compact (without spaces) or a pretty-print format. The default changed to compact format since tools usually transform the JSON objects. --- sql/bytea.sql | 2 +- sql/delete1.sql | 2 +- sql/delete2.sql | 2 +- sql/delete3.sql | 2 +- sql/delete4.sql | 2 +- sql/insert1.sql | 2 +- sql/savepoint.sql | 2 +- sql/specialvalue.sql | 2 +- sql/toast.sql | 2 +- sql/update1.sql | 2 +- sql/update2.sql | 2 +- sql/update3.sql | 2 +- sql/update4.sql | 2 +- wal2json.c | 187 +++++++++++++++++++++++++++++++++++-------- 14 files changed, 165 insertions(+), 48 deletions(-) diff --git a/sql/bytea.sql b/sql/bytea.sql index 5b416580028d..1d0b79d58aed 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -18,5 +18,5 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete1.sql b/sql/delete1.sql index f7db6909f516..cdd056cdf0f7 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -82,5 +82,5 @@ DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql index 987430d3dfb1..2ae89163ae7c 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql index 881bf8f1f173..b7ae61c48e64 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -88,5 +88,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql index 011ffddb644c..190e45f051e8 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -37,5 +37,5 @@ DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql index c1bc2441dd3b..9a14cc3b4552 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -74,5 +74,5 @@ INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUE INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql index 51d237508320..eec0480e1e38 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -24,5 +24,5 @@ RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index 46796ecd223a..6266337e9cd7 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -17,5 +17,5 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index acb2c9b6f95c..6bb192ca349d 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -29,5 +29,5 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql index ccf6788713b4..48129555bdde 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -85,5 +85,5 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql index 049d55b8bae4..55903863ef4a 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql index 47b98bb4fa73..506671195c22 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql index 23cd282b6bac..19a939e271b1 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -38,5 +38,5 @@ UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 6000400b01b2..9415c6a26a81 100644 --- a/wal2json.c +++ b/wal2json.c @@ -45,6 +45,8 @@ typedef struct bool include_schemas; /* qualify tables */ bool include_types; /* include data types */ + bool pretty_print; /* pretty-print JSON? */ + /* * LSN pointing to the end of commit record + 1 (txn->end_lsn) * It is useful for tools that wants a position to restart from. @@ -101,6 +103,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_timestamp = false; data->include_schemas = true; data->include_types = true; + data->pretty_print = false; data->include_lsn = false; data->nr_changes = 0; @@ -168,6 +171,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "pretty-print") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "pretty-print argument is null"); + data->pretty_print = true; + } + else if (!parse_bool(strVal(elem->arg), &data->pretty_print)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-lsn") == 0) { if (elem->arg == NULL) @@ -210,24 +226,43 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) /* Transaction starts */ OutputPluginPrepareWrite(ctx, true); - appendStringInfoString(ctx->out, "{\n"); + if (data->pretty_print) + appendStringInfoString(ctx->out, "{\n"); + else + appendStringInfoChar(ctx->out, '{'); if (data->include_xids) - appendStringInfo(ctx->out, "\t\"xid\": %u,\n", txn->xid); + { + if (data->pretty_print) + appendStringInfo(ctx->out, "\t\"xid\": %u,\n", txn->xid); + else + appendStringInfo(ctx->out, "\"xid\":%u,", txn->xid); + } if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->end_lsn)); - appendStringInfo(ctx->out, "\t\"nextlsn\": \"%s\",\n", lsn_str); + if (data->pretty_print) + appendStringInfo(ctx->out, "\t\"nextlsn\": \"%s\",\n", lsn_str); + else + appendStringInfo(ctx->out, "\"nextlsn\":\"%s\",", lsn_str); pfree(lsn_str); } if (data->include_timestamp) - appendStringInfo(ctx->out, "\t\"timestamp\": \"%s\",\n", timestamptz_to_str(txn->commit_time)); + { + if (data->pretty_print) + appendStringInfo(ctx->out, "\t\"timestamp\": \"%s\",\n", timestamptz_to_str(txn->commit_time)); + else + appendStringInfo(ctx->out, "\"timestamp\":\"%s\",", timestamptz_to_str(txn->commit_time)); + } - appendStringInfoString(ctx->out, "\t\"change\": ["); + if (data->pretty_print) + appendStringInfoString(ctx->out, "\t\"change\": ["); + else + appendStringInfoString(ctx->out, "\"change\":["); OutputPluginWrite(ctx, true); } @@ -249,7 +284,10 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Transaction ends */ OutputPluginPrepareWrite(ctx, true); - appendStringInfoString(ctx->out, "\t]\n}"); + if (data->pretty_print) + appendStringInfoString(ctx->out, "\t]\n}"); + else + appendStringInfoString(ctx->out, "]}"); OutputPluginWrite(ctx, true); } @@ -336,16 +374,35 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu */ if (replident) { - appendStringInfoString(&colnames, "\t\t\t\"oldkeys\": {\n"); - appendStringInfoString(&colnames, "\t\t\t\t\"keynames\": ["); - appendStringInfoString(&coltypes, "\t\t\t\t\"keytypes\": ["); - appendStringInfoString(&colvalues, "\t\t\t\t\"keyvalues\": ["); + if (data->pretty_print) + { + appendStringInfoString(&colnames, "\t\t\t\"oldkeys\": {\n"); + appendStringInfoString(&colnames, "\t\t\t\t\"keynames\": ["); + appendStringInfoString(&coltypes, "\t\t\t\t\"keytypes\": ["); + appendStringInfoString(&colvalues, "\t\t\t\t\"keyvalues\": ["); + } + else + { + appendStringInfoString(&colnames, "\"oldkeys\":{"); + appendStringInfoString(&colnames, "\"keynames\":["); + appendStringInfoString(&coltypes, "\"keytypes\":["); + appendStringInfoString(&colvalues, "\"keyvalues\":["); + } } else { - appendStringInfoString(&colnames, "\t\t\t\"columnnames\": ["); - appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); - appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); + if (data->pretty_print) + { + appendStringInfoString(&colnames, "\t\t\t\"columnnames\": ["); + appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); + appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); + } + else + { + appendStringInfoString(&colnames, "\"columnnames\":["); + appendStringInfoString(&coltypes, "\"columntypes\":["); + appendStringInfoString(&colvalues, "\"columnvalues\":["); + } } /* Print column information (name, type, value) */ @@ -477,27 +534,56 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* The first column does not have comma */ if (strcmp(comma, "") == 0) - comma = ", "; + { + if (data->pretty_print) + comma = ", "; + else + comma = ","; + } } /* Column info ends */ if (replident) { - appendStringInfoString(&colnames, "],\n"); - if (data->include_types) - appendStringInfoString(&coltypes, "],\n"); - appendStringInfoString(&colvalues, "]\n"); - appendStringInfoString(&colvalues, "\t\t\t}\n"); + if (data->pretty_print) + { + appendStringInfoString(&colnames, "],\n"); + if (data->include_types) + appendStringInfoString(&coltypes, "],\n"); + appendStringInfoString(&colvalues, "]\n"); + appendStringInfoString(&colvalues, "\t\t\t}\n"); + } + else + { + appendStringInfoString(&colnames, "],"); + if (data->include_types) + appendStringInfoString(&coltypes, "],"); + appendStringInfoChar(&colvalues, ']'); + appendStringInfoChar(&colvalues, '}'); + } } else { - appendStringInfoString(&colnames, "],\n"); - if (data->include_types) - appendStringInfoString(&coltypes, "],\n"); - if (hasreplident) - appendStringInfoString(&colvalues, "],\n"); + if (data->pretty_print) + { + appendStringInfoString(&colnames, "],\n"); + if (data->include_types) + appendStringInfoString(&coltypes, "],\n"); + if (hasreplident) + appendStringInfoString(&colvalues, "],\n"); + else + appendStringInfoString(&colvalues, "]\n"); + } else - appendStringInfoString(&colvalues, "]\n"); + { + appendStringInfoString(&colnames, "],"); + if (data->include_types) + appendStringInfoString(&coltypes, "],"); + if (hasreplident) + appendStringInfoString(&colvalues, "],"); + else + appendStringInfoChar(&colvalues, ']'); + } } /* Print data */ @@ -609,31 +695,59 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, data->nr_changes++; /* Change starts */ - if (data->nr_changes > 1) - appendStringInfoString(ctx->out, "\t\t,{\n"); + if (data->pretty_print) + { + if (data->nr_changes > 1) + appendStringInfoString(ctx->out, "\t\t,{\n"); + else + appendStringInfoString(ctx->out, "\t\t{\n"); + } else - appendStringInfoString(ctx->out, "\t\t{\n"); + { + if (data->nr_changes > 1) + appendStringInfoString(ctx->out, ",{"); + else + appendStringInfoChar(ctx->out, '{'); + } /* Print change kind */ switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"insert\",\n"); + if (data->pretty_print) + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"insert\",\n"); + else + appendStringInfoString(ctx->out, "\"kind\":\"insert\","); break; case REORDER_BUFFER_CHANGE_UPDATE: - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"update\",\n"); + if(data->pretty_print) + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"update\",\n"); + else + appendStringInfoString(ctx->out, "\"kind\":\"update\","); break; case REORDER_BUFFER_CHANGE_DELETE: - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"delete\",\n"); + if (data->pretty_print) + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"delete\",\n"); + else + appendStringInfoString(ctx->out, "\"kind\":\"delete\","); break; default: Assert(false); } /* Print table name (possibly) qualified */ - if (data->include_schemas) - appendStringInfo(ctx->out, "\t\t\t\"schema\": \"%s\",\n", get_namespace_name(class_form->relnamespace)); - appendStringInfo(ctx->out, "\t\t\t\"table\": \"%s\",\n", NameStr(class_form->relname)); + if (data->pretty_print) + { + if (data->include_schemas) + appendStringInfo(ctx->out, "\t\t\t\"schema\": \"%s\",\n", get_namespace_name(class_form->relnamespace)); + appendStringInfo(ctx->out, "\t\t\t\"table\": \"%s\",\n", NameStr(class_form->relname)); + } + else + { + if (data->include_schemas) + appendStringInfo(ctx->out, "\"schema\":\"%s\",", get_namespace_name(class_form->relnamespace)); + appendStringInfo(ctx->out, "\"table\":\"%s\",", NameStr(class_form->relname)); + } switch (change->action) { @@ -699,7 +813,10 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } - appendStringInfoString(ctx->out, "\t\t}"); + if (data->pretty_print) + appendStringInfoString(ctx->out, "\t\t}"); + else + appendStringInfoChar(ctx->out, '}'); MemoryContextSwitchTo(old); MemoryContextReset(data->context); From 7c9b4839a7f7f6bf312b9aff6087ce727f08d7b0 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 26 Aug 2015 16:31:37 -0300 Subject: [PATCH 014/154] Control how the stream is written. The new parameter 'write-in-chunks' controls how to write in the stream. If true, write occurs per tuple; else it writes at the end of transaction. The default is true. Hence, the behavior is the same as prior code. --- wal2json.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/wal2json.c b/wal2json.c index 9415c6a26a81..1db8ba243cc7 100644 --- a/wal2json.c +++ b/wal2json.c @@ -46,6 +46,7 @@ typedef struct bool include_types; /* include data types */ bool pretty_print; /* pretty-print JSON? */ + bool write_in_chunks; /* write in chunks? */ /* * LSN pointing to the end of commit record + 1 (txn->end_lsn) @@ -104,6 +105,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_schemas = true; data->include_types = true; data->pretty_print = false; + data->write_in_chunks = true; data->include_lsn = false; data->nr_changes = 0; @@ -184,6 +186,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "write-in-chunks") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "write-in-chunks argument is null"); + data->write_in_chunks = true; + } + else if (!parse_bool(strVal(elem->arg), &data->write_in_chunks)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-lsn") == 0) { if (elem->arg == NULL) @@ -264,7 +279,8 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) else appendStringInfoString(ctx->out, "\"change\":["); - OutputPluginWrite(ctx, true); + if (data->write_in_chunks) + OutputPluginWrite(ctx, true); } /* COMMIT callback */ @@ -282,12 +298,21 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, elog(DEBUG1, "# of subxacts: %d", txn->nsubtxns); /* Transaction ends */ - OutputPluginPrepareWrite(ctx, true); + if (data->write_in_chunks) + OutputPluginPrepareWrite(ctx, true); if (data->pretty_print) + { + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks) + appendStringInfoChar(ctx->out, '\n'); + appendStringInfoString(ctx->out, "\t]\n}"); + } else + { appendStringInfoString(ctx->out, "]}"); + } OutputPluginWrite(ctx, true); } @@ -634,7 +659,8 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); - OutputPluginPrepareWrite(ctx, true); + if (data->write_in_chunks) + OutputPluginPrepareWrite(ctx, true); /* Make sure rd_replidindex is set */ RelationGetIndexList(relation); @@ -697,10 +723,16 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Change starts */ if (data->pretty_print) { + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks) + appendStringInfoChar(ctx->out, '\n'); + + appendStringInfoString(ctx->out, "\t\t"); + if (data->nr_changes > 1) - appendStringInfoString(ctx->out, "\t\t,{\n"); - else - appendStringInfoString(ctx->out, "\t\t{\n"); + appendStringInfoChar(ctx->out, ','); + + appendStringInfoString(ctx->out, "{\n"); } else { @@ -821,5 +853,6 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, MemoryContextSwitchTo(old); MemoryContextReset(data->context); - OutputPluginWrite(ctx, true); + if (data->write_in_chunks) + OutputPluginWrite(ctx, true); } From 0b653ee46bb75fd5301277bca56a1dce8a60ffb6 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 27 Aug 2015 16:51:42 -0300 Subject: [PATCH 015/154] Add a real README. README has instructions to build and install wal2json. Also, there are examples of use. --- README.md | 315 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 313 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7fe8f0f51768..75cbdc1d4c6d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,315 @@ -wal2json +Introduction +============ + +**wal2json** is an output plugin for logical decoding. It means that the plugin have access to tuples produced by INSERT and UPDATE. Also, UPDATE/DELETE old row versions can be accessed depending on the configured replica identity. Changes can be consumed using the streaming protocol (logical replication slots) or by a special SQL API. + +The **wal2json** output plugin produces a JSON object per transaction. All of the new/old tuples are available in the JSON object. Also, there are options to include properties such as transaction timestamp, schema-qualified, data types, and transaction ids. + +**wal2json** is released under PostgreSQL license. + +Requirements +============ + +* PostgreSQL 9.4+ + +Build and Install +================= + +This extension is supported on [those platforms](http://www.postgresql.org/docs/current/static/supported-platforms.html) that PostgreSQL is. The installation steps depend on your operating system. + +You can also keep up with the latest fixes and features cloning the Git repository. + +``` +$ git clone https://github.com/eulerto/wal2json.git +``` + +Unix based Operating Systems +---------------------------- + +Before use this extension, you should build it and load it at the desirable database. + +``` +$ git clone https://github.com/eulerto/wal2json.git +$ PATH=/path/to/bin/pg_config:$PATH +$ USE_PGXS=1 make +$ USE_PGXS=1 make install +``` + +Windows +------- + +Sorry, never tried it. ;( + +Configuration +============= + +You need to set up at least two parameters at postgresql.conf: + +``` +wal_level = logical +max_replication_slots = 1 +``` + +After changing these parameters, a restart is needed. + +Examples ======== -JSON output plugin for changeset extraction +There are two ways to obtain the changes (JSON objects) from **wal2json** plugin: (i) calling functions via SQL or (ii) pg_recvlogical. + +pg_recvlogical +-------------- + +Besides the configuration above, it is necessary to configure a replication connection to use pg_recvlogical. + +First, add an entry at pg_hba.conf: + +``` +local replication myuser trust +host replication myuser 10.1.2.3/32 trust +``` + +Also, set max_wal_senders at postgresql.conf: + +``` +max_wal_senders = 1 +``` + +A restart is necessary if you changed max_wal_senders. + +You are ready to try wal2json. In one terminal: + +``` +$ pg_recvlogical -d postgres --slot test_slot --create-slot -P wal2json +$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -o write-in-chunks=0 -f - +``` + +In another terminal: + +``` +$ cat /tmp/example1.sql +CREATE TABLE table_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); + +BEGIN; +INSERT INTO table_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table_with_pk (b, c) VALUES('Replication', now()); +DELETE FROM table_with_pk WHERE a < 3; + +INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); +-- it is not added to stream because there isn't a pk or a replica identity +UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +COMMIT; + +$ psql -At -f /tmp/example1.sql +CREATE TABLE +CREATE TABLE +BEGIN +INSERT 0 1 +INSERT 0 1 +INSERT 0 1 +DELETE 2 +INSERT 0 1 +UPDATE 1 +COMMIT +``` + +The output in the first terminal is: + +``` +{ + "xid": 34225, + "change": [ + ] +} +{ + "xid": 34226, + "change": [ + ] +} +WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/126E5F70 +{ + "xid": 34227, + "change": [ + { + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [1, "Backup and Restore", "2015-08-27 16:46:35.818038"] + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [2, "Tuning", "2015-08-27 16:46:35.818038"] + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [3, "Replication", "2015-08-27 16:46:35.818038"] + } + ,{ + "kind": "delete", + "schema": "public", + "table": "table_with_pk", + "oldkeys": { + "keynames": ["a", "c"], + "keytypes": ["int4", "timestamp"], + "keyvalues": [1, "2015-08-27 16:46:35.818038"] + } + } + ,{ + "kind": "delete", + "schema": "public", + "table": "table_with_pk", + "oldkeys": { + "keynames": ["a", "c"], + "keytypes": ["int4", "timestamp"], + "keyvalues": [2, "2015-08-27 16:46:35.818038"] + } + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_without_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "numeric", "text"], + "columnvalues": [1, 2.34, "Tapir"] + } + ] +} +``` + +Dropping the slot in the first terminal: + +``` +Ctrl+C +$ pg_recvlogical -d postgres --slot test_slot --drop-slot +``` + +SQL functions +------------- + +``` +$ cat /tmp/example2.sql +CREATE TABLE table_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); + +SELECT 'init' FROM pg_create_logical_replication_slot('test_slot', 'wal2json'); + +BEGIN; +INSERT INTO table_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table_with_pk (b, c) VALUES('Replication', now()); +DELETE FROM table_with_pk WHERE a < 3; + +INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); +-- it is not added to stream because there isn't a pk or a replica identity +UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +COMMIT; + +SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'pretty-print', '1', 'write-in-chunks', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('test_slot'); +``` + +The script above produces the output below: + +``` +$ psql -At -f /tmp/example2.sql +CREATE TABLE +CREATE TABLE +init +BEGIN +INSERT 0 1 +INSERT 0 1 +INSERT 0 1 +DELETE 2 +INSERT 0 1 +UPDATE 1 +COMMIT +psql:/tmp/example2.sql:17: WARNING: table "table_without_pk" without primary key or replica identity is nothing +CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/12713E40 +{ + "xid": 34232, + "change": [ + { + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [1, "Backup and Restore", "2015-08-27 16:49:37.218511"] + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [2, "Tuning", "2015-08-27 16:49:37.218511"] + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_with_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "varchar", "timestamp"], + "columnvalues": [3, "Replication", "2015-08-27 16:49:37.218511"] + } + ,{ + "kind": "delete", + "schema": "public", + "table": "table_with_pk", + "oldkeys": { + "keynames": ["a", "c"], + "keytypes": ["int4", "timestamp"], + "keyvalues": [1, "2015-08-27 16:49:37.218511"] + } + } + ,{ + "kind": "delete", + "schema": "public", + "table": "table_with_pk", + "oldkeys": { + "keynames": ["a", "c"], + "keytypes": ["int4", "timestamp"], + "keyvalues": [2, "2015-08-27 16:49:37.218511"] + } + } + ,{ + "kind": "insert", + "schema": "public", + "table": "table_without_pk", + "columnnames": ["a", "b", "c"], + "columntypes": ["int4", "numeric", "text"], + "columnvalues": [1, 2.34, "Tapir"] + } + ] +} +stop +``` + +License +======= + +> Copyright (c) 2013-2015, Euler Taveira de Oliveira +> All rights reserved. + +> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +> Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 806f2441c63a50877c03d2c1cdd225e6f0648130 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 4 Apr 2016 23:36:52 -0300 Subject: [PATCH 016/154] Add Coverity Scan Badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 75cbdc1d4c6d..a0c0840a83cf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Coverity Scan Build Status](https://scan.coverity.com/projects/4832/badge.svg)](https://scan.coverity.com/projects/wal2json) + Introduction ============ From c990ea1a138755b8c9554f8e1aea6b20b6dc00f6 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 4 Jan 2017 10:03:49 -0300 Subject: [PATCH 017/154] Replace palloc with palloc0 Avoid garbage on JsonDecodingData. --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 1db8ba243cc7..ef87519e9f4e 100644 --- a/wal2json.c +++ b/wal2json.c @@ -94,7 +94,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is ListCell *option; JsonDecodingData *data; - data = palloc(sizeof(JsonDecodingData)); + data = palloc0(sizeof(JsonDecodingData)); data->context = AllocSetContextCreate(TopMemoryContext, "text conversion context", ALLOCSET_DEFAULT_MINSIZE, From f29506ebecd0b22906896e0aae2672d231cc05db Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 4 May 2017 02:06:22 +0100 Subject: [PATCH 018/154] Fixed tests results --- expected/bytea.out | 2 +- expected/delete1.out | 2 +- expected/delete2.out | 2 +- expected/delete3.out | 2 +- expected/delete4.out | 2 +- expected/insert1.out | 2 +- expected/savepoint.out | 2 +- expected/specialvalue.out | 2 +- expected/toast.out | 2 +- expected/update1.out | 2 +- expected/update2.out | 2 +- expected/update3.out | 2 +- expected/update4.out | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 2af27d54ec82..4b7cee875f9e 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -22,7 +22,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/expected/delete1.out b/expected/delete1.out index 40925f6bb5fd..ba50b56e60d7 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -76,7 +76,7 @@ DELETE FROM table_without_pk WHERE b = 1; DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/delete2.out b/expected/delete2.out index 381feba61264..07dbb19ccd5e 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/delete3.out b/expected/delete3.out index 90cd63c23194..70e52e0c00a4 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -82,7 +82,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/delete4.out b/expected/delete4.out index 2ec6449dade3..a7a8dd7bee1a 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -35,7 +35,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data ----------------------------------------------------------------- { + diff --git a/expected/insert1.out b/expected/insert1.out index df4d61634d04..b2d60482c52a 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -71,7 +71,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/savepoint.out b/expected/savepoint.out index 45922b42463a..5edcfa02fec4 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -23,7 +23,7 @@ ROLLBACK TO SAVEPOINT sp2; RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data ---------------------------------------------------------- { + diff --git a/expected/specialvalue.out b/expected/specialvalue.out index dcabfba2d8c0..9959fce57efc 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -17,7 +17,7 @@ INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data -------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/toast.out b/expected/toast.out index 06375baa7670..22499bd0900f 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -29,7 +29,7 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: column "toasted_col2" has an unchanged TOAST WARNING: column "toasted_col1" has an unchanged TOAST WARNING: column "toasted_col2" has an unchanged TOAST diff --git a/expected/update1.out b/expected/update1.out index 3c7c3537f93e..d1ec7a1f4317 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -78,7 +78,7 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/update2.out b/expected/update2.out index fc34f0de33c8..7fc9cb5faa7e 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/update3.out b/expected/update3.out index 9c21441b6e9a..e0e7acc3ff72 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update4.out b/expected/update4.out index 9627806f4375..8d06fe2d8d3f 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -36,7 +36,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + From 4296b0873c7e0d759db3ecd2a6e7d48f75dd7aaa Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 4 May 2017 23:31:34 +0100 Subject: [PATCH 019/154] Give an error instead of a warning in case of bad param --- Makefile | 2 +- expected/cmdline.out | 17 +++++++++++++++++ sql/cmdline.sql | 10 ++++++++++ wal2json.c | 9 +++++---- 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 expected/cmdline.out create mode 100644 sql/cmdline.sql diff --git a/Makefile b/Makefile index e26a32d5e2f7..ee71f1dd1ab1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MODULES = wal2json -REGRESS = insert1 update1 update2 update3 update4 delete1 delete2 \ +REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea PG_CONFIG = pg_config diff --git a/expected/cmdline.out b/expected/cmdline.out new file mode 100644 index 000000000000..63a3d016b2ba --- /dev/null +++ b/expected/cmdline.out @@ -0,0 +1,17 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +ERROR: unknown parameter nosuchopt = 42 +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/cmdline.sql b/sql/cmdline.sql new file mode 100644 index 000000000000..8d2d1693a147 --- /dev/null +++ b/sql/cmdline.sql @@ -0,0 +1,10 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index ef87519e9f4e..942851e0341d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -213,10 +213,11 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is strVal(elem->arg), elem->defname))); } else - { - elog(WARNING, "option %s = %s is unknown", - elem->defname, elem->arg ? strVal(elem->arg) : "(null)"); - } + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("unknown parameter %s = %s", + elem->defname, + elem->arg ? strVal(elem->arg) : "(null)"))); } } From cffde2b8e72cab6175e3298d7344f8e5c395082e Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 4 May 2017 02:04:23 +0100 Subject: [PATCH 020/154] Added gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..7b4717f71b2c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/regression.diffs +/regression.out +/results/ +/wal2json.so From 1183365518c6bac45813ec5a639eb5182db72bf8 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 7 May 2017 10:26:57 +0100 Subject: [PATCH 021/154] Ignore .o files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7b4717f71b2c..074fa38fe5ec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /regression.out /results/ /wal2json.so +*.o From 0e5c5f95807c7679b7fc59721e57e34c70ee00b5 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 7 May 2017 10:33:27 +0100 Subject: [PATCH 022/154] Error message on unknown params reworded --- expected/cmdline.out | 2 +- wal2json.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/expected/cmdline.out b/expected/cmdline.out index 63a3d016b2ba..310278912ff4 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -8,7 +8,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js (1 row) SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); -ERROR: unknown parameter nosuchopt = 42 +ERROR: option "nosuchopt" = "42" is unknown SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/wal2json.c b/wal2json.c index 942851e0341d..363a2cff8b37 100644 --- a/wal2json.c +++ b/wal2json.c @@ -215,7 +215,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("unknown parameter %s = %s", + errmsg("option \"%s\" = \"%s\" is unknown", elem->defname, elem->arg ? strVal(elem->arg) : "(null)"))); } From ef49435a4da82562e82956ccef3698539ecfc4a9 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 9 May 2017 02:20:33 +0100 Subject: [PATCH 023/154] Default for write-in-chunks changed to false --- expected/bytea.out | 14 +++++++------- expected/cmdline.out | 19 +++++++++++++++++++ expected/delete1.out | 10 +++++----- expected/delete2.out | 20 ++++++++++---------- expected/delete3.out | 30 +++++++++++++++--------------- expected/delete4.out | 14 +++++++------- expected/insert1.out | 10 +++++----- expected/savepoint.out | 22 +++++++++++----------- expected/specialvalue.out | 14 +++++++------- expected/toast.out | 22 +++++++++++----------- expected/update1.out | 14 +++++++------- expected/update2.out | 20 ++++++++++---------- expected/update3.out | 26 +++++++++++++------------- expected/update4.out | 14 +++++++------- sql/cmdline.sql | 6 ++++++ wal2json.c | 2 +- 16 files changed, 141 insertions(+), 116 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 4b7cee875f9e..cfdbdf7fd4cf 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -27,7 +27,7 @@ WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -35,11 +35,11 @@ WARNING: column "bincol" has an unchanged TOAST "columnnames": ["id", "rand1", "bincol"], + "columntypes": ["int4", "float8", "bytea"], + "columnvalues": [1, 0.230543947778642, "0420019803930402045901000170038901410282024303210187026304890472032803710073031500080127007204210082021000680057052701150272044603260158034002800265052201570416028404170217048401540192044105030038052102890047010603670493019400360011025500350133054505070479015003050212043102910380030300220250053405340415016404260370020503990096025605130484019301340524020604040564034803890509026105500237048604090546028901300572055500890533038802620377017104790188027401390115017003430257010505610064007803080474061405840428024004710232018501470369015500970465008005050105047600480609003403350113015505150474042506280416049500610088034000510046013403040540037804990034010506640136059300840667003605830049000306210400012201100265061905570244037603950309047000680364052002090684039806060517043600250520058006450610058106860521063406910469035101160587062900550461017604480163050002270235016600530455016104690369070202030396052200820343043206890330024606210319000202540441061501730500035803580227053001360464003103100521050504790261013904590474055202490561015307000521049801960407006702000673052700720086027904450459051602240602022402560148076800030647026001480343075307230603055200960542030406140749072806860162063304380238072507300702040104640131022106990398037606880403023701470558059401140493040306870595014601830411010001140298026907730754051706960682041402800330055105100217012700610091054603070244028000770362079304960226056106500416013407560536044401790480036707150340021102820632055408550294078101190358000506850678025701010760063400430396087006250186041907670083008803400269058507220118004600480410070006210398010705310522047805380328027608060433015405550479056405440214075900640091084801560443020807620268033008120319075506120034023907250583078002880207018505740103063307350677018903780298041002190365050501470528001403620364029107040249062205290882065907780671030006230006051508160599062305030389035206990781066101490032006206710184060706880558000100060301025806480848017903380662087306490312088101860157050308290676090601920396071008740551074509410235093705580946050105610954081308290606067010160956033208950604065407800797081802710623048601720823089509040689042806360621067205610155060400340733054308730540011805150537005108580406067304780152043702620432001907630610086606210477051010640063008006870641023902360678099507950499047409191031102809750832036205830238052010350509096610570201050208550841099302830838106103660444061906130688021105300399072610180234067509640122041702220723066307580668006606300634027300210388001010430680087210041057019605080554090407271100017703341007041810290856054503131087014109960717082810660212032601930235072502040147026411000016018701400539075710690118071900830461058205130344028710740667022500410510096208910422118300420621023907870833039010600772040800600917096208370818108503760904035809740228071300650123019002950165071400701080114900681126057103130716020607140583099811340646071408960277032507800663002111490429025406460496038108430801055103340875041402670947032208540020105710670753040308380662106603150323009206491123077206711039121409330436045700560030000606200373090310470648059701000244062011840056010803150915078701201239111902140615097910060009075009550965119801251025123201320358031210580124097703630227122909980127128911120449091206020573086304280794017201080501018208760152117007750281089007050417125910260163005106890535028406070215041405830007087501700623011410541063092612321175008500640716024112620149052808130871095607370556112507911263030410830514052501341112053310301288117211480987087807140865069608030933004110510834019302010273108411791027025709330438014812460143067403800281040509261334031307151099132302010417079409131239033009570894118411571101004108420881109111070407011012600248025705160636054409310145046912530876015011641083057705310571039408690099130906281281098206710687042603270359084304400184109707030712028212610196043102720004132704261193096010150259006614201148016712770308147607970993069312341330106106050289125202311008048505200798068609611077069108140009040502891046067003570987033105290779064605210077014312291336150107930433027505480670130410441202059102150653015809211485016813360245123504820610070308211150149914820137003200821392139500620651028603421211097001150719063807180940130608810316125810540112151007460604056314641443016314201381030314551467014212991533080600070299045609960416119000581149055813900455088210781530099810200693001415970583148501590425128804680300117606140011112714370019143302861035024015001096141204480890025213480363018407381404089107531400148706331565028503080405059115061032060410120852062408271145003010731023114708601482040011191200077013080293054005551061030304060041023006970354064413010217002202431249089008790415037709111509142103960703124708040156078315911489108304510364047107610778051409971489087616541113109816791363066508810551108912661480091410010171163205560990007513540891159107361352024012170402103200141417081909051371022002901347160809680507043103370055019512681075037011851643137912631273053611320270015813781510056706711526025015060688164517320984125216040202000002740545005604740062115008511268104504750774056010220143083611851546058617640441034902290181104901090148025613831780046213850260101714450743108208101610056500640285135406341325150214850716125902640691171006200925007316891037022401240617020505930195047016291664122708960653102714720720131910091365082406921031155401251302040800120081135000861799055003140068117805240672137810030465120703851377000414301005073609010158025017410862129914450990074418621004082713531093077100271415084112250057152607341077010500651470150500691026062608180039078810731809166604871370076412431352178601710814098309550842050318120166056214420913165715510980122511521052033817911885037806581041028004131538167311910860110610621036193401150059084306261900101411981412194309271032098202140243009105570099004109430768109912281189069209570427156701071507064500941626070509510283065319821501010319720457115109830675140010771242150211200205028602391452149409420424193005300533145711860630110119041597139005561598090006611585136618310564003212321658129307340771150310251015094905121973138104380479192419171684052709971578010603660100172912810771129206200581186606531833149819670523022514371565125603400024119717430469168516310347132700971359085802051733096119600957174511941588025510080168003104440078056206731536006119481884008510711560056106851118091420331218019208031428195117791312081614430415031717041438048817381890056801910455000702530310191903401398137709102095038418392030162020360713093518820381012905731846055008951433200913911051178219691247009519791506041017731853182910150620179814060325169608870226025618382135064319710548034403581457179902210693069020290511195621280336130203622135099600300979162618540214195813831114219016450781215900990580051604480944199500681169049207671018101105400965135318601334130306551367007800841027029520700206142520661874221920291977057903220200153701090269048606081047152016341596025607631238160920851904074721671992178902151838200016601677164416521476138822411804159315361917186820310266066113021922000615640422126109190257091316780173065112100390022909532073193003311459113617391439067110600700031706560460058713271780023213351061066003071995092212331386109818950300149521291266127917681603043805991044189712802119028116040457074822011803021901040822129507731134097817080043004104791963034519941776162909431219090313881828196209560770175412430036221920022266168422260008015211730791130221660150134722100635096201850279038418361235161903700259108823581228187017490099190916072127181409211989182410760781022823970574038013610408102523370596130803190046014919600421041106480393165601242165175820581373149114732308108008950972187311260969002315132348043701162280104114410165108915942150151620130363191612440489166005740121059920841613048007230062146501591203244801820272236206250390220616801850237603120993208118470555245113111815046805112398059211192026222616060271229206000432102005850617129704811251169302150452106701180768207322250133013022011460196801651980188507650598142105022225169703020313213613350906023801231395150418371614196403871735020924861453034400821143182220741311128514402087189203320048159720500354191616601706027919031832169108681133076502941525252305061477142808551561001601281089134314292548088007670307093023842382129017421481043120270820228611511699084319271998238818862513128707350781026707520912137021122359134303970529165613400331145500322094033904691529117001630075026910162025229108071309220921102054037023830184129311372322104424970087158115341443191703651477139207081953029218932120036821670496241718311313108614090790050417850539069104301690037414871549046304170431192323570800074410911517004113880753218617610262000615222115133426220853213504432659268311430402169815221907056619912331100212352014181319880412064120331816140315330886166915412427109201732362195623330090192423241246233313160058153418902072116101720588046320062600088026561918271813350727087202792286057913842464021806122073030925581670157021620243163009552155096421302332156026001595142207231511059106990089132615810371086121691771057223922391266927072195157415101595182103682562121013441924077301251758238615632491111421620396120506991995158215711380056321510987016720380909238608132437118126552812095010571348007018401477184814240228153625522414193809380287111925381875251602671209067204360425159200011247120811951081119921572151256322301155120012402596143127942315100818900398129901540094032526970364154805050806197921150808036104572017145416691314074413750682191225901936164611461869109321660884149605821040159209110865196224771376277915710606068819381068272704962756114212481231183302630929087019272088275901071352072716191942177902982865265522822436111121541087172428520105280526680607264808781869094627312136188606601131104304931240241112282878141500660219134827492525084409071735194326501648205225141370266722162259157901942040075721002709190101700223016926061464008610461532030724101316285802662233161522301912027813011449166309900681093825870877300003413000272522630157295224352791141325240827296328370237126826990506049613022760242815851043085802292044154611761618243411651965242208731205258408070617235522360115013921762981037804012652089009030909061602922510167011592744066727220864230221112042121414842926243310170664305903142923009404552038001808372446269717370268052523610563306109521735273616271385051008510415257320781914242314292943309614080151293815040610188315241456123511290090150716602474207716260310070212611954210217772816252212421781132005510086115305371508130603603028192422611421024603592562033718811086283608242729315215330844196704942639164730420729027912091286036623751830188905222194177224651301002827161665261630590381052927391214009627342763094715300071041831953143115502811167245506510364110025590891011011420172142411712914310706002791027911342340150412321882107421890205114626140204109205530488227230321145264109110494030610241647048024622831018023570194299726401339211409122584076419961543097231550926117910021486167300351285283027012207006430123242172702292459131304101565151101590954286422941876219330670609046707650507140219561520290303551556091032120988313832800731311417250962229630531377057212731540153608550545011930700328073302281101124616443077278112540115103021740031202920160013276818301754040908141502180013932788001629440313056730670068089804640298201017221958176711783226188422192067191709110744193203452591034107580051185725751456130425941058162131690780169107021249199427322988059111350797046330383037255015870570330301470919252804911685258223660887065502840105172319213303251202230608036622363365338228351101077533050752042324632354099923782505192715073003020206871965109813482254120530880760110421890986171925613243167525342663278833172554010202991593247713070541155432532062112900032757311311100659192823270311269634442520022517121636002734040721271427450593181728500896342518712216049134412014257310962019186807483141253426941998285019211977189721500206004921790137077614142907137532482275228031960653100401800610303727761717155811432473120601771670322230520082169114402251190014900919204022742346143701262086019424261769085334411952146929621206320209862360214822032540027918992065036200473519263419641462356304590191236519080318090121052766268729672665108208742077230005253072110026921713007829750043216133430091212124112072000324112536019612010864051721112989330712192379239223113263088010230184036721332899209622142286214107762040223429160850070229213283326131210868050500142999352033500595228621282927194030180320212733912472140818611059006703721843212526261132298433360423264129693570351934813588288333703304348620121785277203001159309724460905191701932783298702613161116624032128230817301808273607061115264905640935257634720640221432932669031823912974148718121740240100411935150130532200097905190912312628472657123518913372236008430221330534413723022719503318291822722001218800400096020924610137216102383215063912253741156006332869049318781029014305091879036700881596036503173563371132602096196917052138206819180854220703291094168009742329168025472969079730471086183531941601373135661691155701502011136201021508347620873229183903781368270126031701000504972684235421911448154229960712263910370121044109853716214625560052035701110154187836162259130916472641269005421438057505481940328229210315090706403336162633000542174937481536165120670266170424280378186104700169028417911829294706442377053812252931249406692012281415852659230832252116285711172020053127820228079906222676118024983152135127861073319618701723170424132959076610343636279538711337157723000687371112771814184418130711207526201339086238123858012512612752120705650719294422833152200530570271174519480245309435392563379033483853168512721745240333650447375402940345370004201617252916372187325606540537248226753618275704781626300635971232162834550642154611891925330736121346375934251643013531802068176517533719397110530398053135553094019123483578183013883214307330302704372205943904166639273545302437152996067838542196276216273964250216181015290421540583200823492950159501740329081232713383353729983984344506493913298836973625197403463475015131301077010416122708112804940835171625183203064000763380097208952624032504031588028138752243016128261906381507522257325209041343026810102968299821473468384138781929299104442007231714232910087617523318247720363133064722001889256919502648074611293561210014000478098703162642037500792442231930932891022913160213316121991978238705774031142412302127332938194094187104441104132925602515181235572835033839382917279821361894157023693220178614081291378038151873369210993113168302982806165121833255276435241674113611861093399315280892276501773045050217591258374635592678087031902342275827293451171102413754035119041766363104981124112616422320222814683861312800544042199505591612326401270991175510044205411637832743338112932987294716480687050610851189163922202845397702380097363933890151348011670715087002190843186919881855186418931423038310542727339340230139408802831231103519353468390116843710400110902865415703324043061412094267146330922001333306993909049410850696324102250468338300600754034111032703383507450112328504851210188003781546165709962765165724711581367315272286330820253381401109813609017400773673093304210470365742831220377232741709067108452091222925153096068741851256227935552795024825530499365422561487295024321566230733741991278227111957401321620904138428391756349207294290225414214147352037173366197239701573247632843846397618851925118242100949318826373680078122991478169236954338346228270687339507092118318242551469218018481072376543434379324039481878077707361713173339474370103003252276251920291584247311000014316601000728088033050590236010762451344104402397342237031942088200522685260817972222257028362552042109300152201734211260203321621361276830490236336409721319137744381763379134251030128543151083399024762893176005951279433110202216001130521185127906213362265034081951288923122931422036992912150730271870254543241720363738464215205311200315334209771342106909884416226322770533113804343965310433441779153930760985447200734034183426363864356717713209328338394339360326720791042037511786032814924080086426394520031212193342210327701891309627221967260600150066194036071849061323541154041914183845121518433056301521744560255330452646253033623875131809032086322440210245062220620261068840173892255000461672371304683102299116920361147101282549146126981013412606414398342219680700091306030135116112292211142419221637072444911684240836082156090619943861127034763992383703162077022444692723001432780067071941990674085607261911308221603848008328903719177906622698395115750049318128543548254020553868463322823702270922982334277830231890345838872622070723140120458123993030364441913699167734830598172719973471060845560848450145263146353325570761118406533805308841343014102301400636114400403051419537092556320506821346380924213357258330343221343928413052188016700897264828641555174512390981004322691123068334231165375429040153158313840840293904693277156830691579005617774439312736711363403215764247083633340730182533803015295640691690413030764614428746721232035728531704365544320011046244911800014228530706151521212293099629640854173100054256476729803552166823351846150718451741274822054614446510724264447815383970147416822023218532074159449442122319053011292326481410960494355927762845058342944704233622222085213918743165158715364715073530211561277203704790210600394175444205720455192505551558242341384353042247273810028722111177238543653064069710894612056518302775213646203149207318583190138914413768184833794329341709263600290513513462184116410788302740420277120847461374094204093216373525582954199346464826028711291359407929904760351515070770221444312130077013563782156344032918184406852760322716333173152404510806449824570536440927471673083019034683066704871247144227150748358634922113243301041581040619592272318302383917140617724373221813241872275907834638444416191573417622912064044737444797120023653323332748153429492002300406221134330646"]+ - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -52,11 +52,11 @@ WARNING: column "bincol" has an unchanged TOAST "keytypes": ["int4"], + "keyvalues": [1] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -66,10 +66,10 @@ WARNING: column "bincol" has an unchanged TOAST "keytypes": ["int4"], + "keyvalues": [1] + } + - } + } + ] + } -(9 rows) +(3 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/cmdline.out b/expected/cmdline.out index 310278912ff4..ebd0e7c58479 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -9,6 +9,25 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); ERROR: option "nosuchopt" = "42" is unknown +-- By default don't write in chunks +CREATE TABLE x (); +DROP TABLE x; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', 'f'); + data +--------------- + {"change":[]} + {"change":[]} +(2 rows) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'f', 'write-in-chunks', 't'); + data +------------- + {"change":[ + ]} + {"change":[ + ]} +(4 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/delete1.out b/expected/delete1.out index ba50b56e60d7..d1184a55edf7 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -82,11 +82,11 @@ WARNING: table "table_with_unique" without primary key or replica identity is n data ----------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -96,14 +96,14 @@ WARNING: table "table_with_unique" without primary key or replica identity is n "keytypes": ["int2", "int4", "int8"],+ "keyvalues": [1, 2, 3] + } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(7 rows) +(3 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/delete2.out b/expected/delete2.out index 07dbb19ccd5e..0a4f49c0615c 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -87,42 +87,42 @@ WARNING: table "table_with_unique" without primary key or replica identity is n data --------------------- { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } -(18 rows) +(9 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/delete3.out b/expected/delete3.out index 70e52e0c00a4..1919933b914f 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -86,11 +86,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -100,11 +100,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -114,19 +114,19 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [2, 4, 5, 6, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -136,19 +136,19 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -158,14 +158,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(24 rows) +(10 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/delete4.out b/expected/delete4.out index a7a8dd7bee1a..063a7b71d2d7 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -39,11 +39,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data ----------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -53,11 +53,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["float8", "bool"],+ "keyvalues": [1.23, false] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -67,14 +67,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["float8", "bool"],+ "keyvalues": [4.56, true] + } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(10 rows) +(4 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/insert1.out b/expected/insert1.out index b2d60482c52a..26d6dae0245a 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -75,7 +75,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -83,7 +83,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -91,7 +91,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -99,10 +99,10 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ - } + } + ] + } -(5 rows) +(1 row) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/savepoint.out b/expected/savepoint.out index 5edcfa02fec4..bd4c034ab367 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -27,7 +27,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data ---------------------------------------------------------- { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -35,11 +35,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [1, "john"] + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -47,11 +47,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [2, "smith"] + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -59,11 +59,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [3, "robert"] + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -71,7 +71,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [4, "marie"] + - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -79,7 +79,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [5, "ernesto"] + - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -87,10 +87,10 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b"], + "columntypes": ["int4", "text"],+ "columnvalues": [8, "francisco"]+ - } + } + ] + } -(14 rows) +(4 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/specialvalue.out b/expected/specialvalue.out index 9959fce57efc..ba2f63b3f1f1 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -21,11 +21,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data -------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -33,7 +33,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d"], + "columntypes": ["int4", "bool", "varchar", "float4"], + "columnvalues": [1, true, "test1", null] + - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -41,7 +41,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d"], + "columntypes": ["int4", "bool", "varchar", "float4"], + "columnvalues": [2, false, "test2", null] + - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -49,7 +49,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d"], + "columntypes": ["int4", "bool", "varchar", "float4"], + "columnvalues": [3, null, "null", null] + - } + } + ,{ + "kind": "insert", + "schema": "public", + @@ -57,10 +57,10 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "columnnames": ["a", "b", "c", "d"], + "columntypes": ["int4", "bool", "varchar", "float4"], + "columnvalues": [4, true, "valid: ' \" \\ \/ \b \f \n \r \t ⁿ 陿 invalid: \\g \\k end", 123.456]+ - } + } + ] + } -(8 rows) +(2 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/toast.out b/expected/toast.out index 22499bd0900f..53792cb683e3 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -36,7 +36,7 @@ WARNING: column "toasted_col2" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -44,11 +44,11 @@ WARNING: column "toasted_col2" has an unchanged TOAST "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + "columntypes": ["int4", "text", "float8", "text", "float8"], + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 0.840187716763467, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 0.394382926635444] + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "insert", + "schema": "public", + @@ -56,11 +56,11 @@ WARNING: column "toasted_col2" has an unchanged TOAST "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + "columntypes": ["int4", "text", "float8", "text", "float8"], + "columnvalues": [2, null, 0.783099223393947, "0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500", 0.798440033104271]+ - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -73,11 +73,11 @@ WARNING: column "toasted_col2" has an unchanged TOAST "keytypes": ["int4"], + "keyvalues": [1] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -90,11 +90,11 @@ WARNING: column "toasted_col2" has an unchanged TOAST "keytypes": ["int4"], + "keyvalues": [1] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "delete", + "schema": "public", + @@ -104,10 +104,10 @@ WARNING: column "toasted_col2" has an unchanged TOAST "keytypes": ["int4"], + "keyvalues": [1] + } + - } + } + ] + } -(15 rows) +(5 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/update1.out b/expected/update1.out index d1ec7a1f4317..9a3a2334ff29 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -84,11 +84,11 @@ WARNING: table "table_with_unique" without primary key or replica identity is n data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -101,11 +101,11 @@ WARNING: table "table_with_unique" without primary key or replica identity is n "keytypes": ["int2", "int4", "int8"], + "keyvalues": [1, 2, 3] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -118,14 +118,14 @@ WARNING: table "table_with_unique" without primary key or replica identity is n "keytypes": ["int2", "int4", "int8"], + "keyvalues": [1, 2, 3] + } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(10 rows) +(4 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/update2.out b/expected/update2.out index 7fc9cb5faa7e..15ad68687574 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -87,42 +87,42 @@ WARNING: table "table_with_unique" without primary key or replica identity is n data --------------------- { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } { + - "change": [ + "change": [+ ] + } -(18 rows) +(9 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/update3.out b/expected/update3.out index e0e7acc3ff72..cfe3476add14 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -84,11 +84,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -101,19 +101,19 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -126,19 +126,19 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -151,14 +151,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "keyvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(21 rows) +(9 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/update4.out b/expected/update4.out index 8d06fe2d8d3f..e3ad19e5dc8b 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -40,11 +40,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + - "change": [ + "change": [ + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -57,11 +57,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["float8", "bool"], + "keyvalues": [1.23, false] + } + - } + } + ] + } { + - "change": [ + "change": [ + { + "kind": "update", + "schema": "public", + @@ -74,14 +74,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc "keytypes": ["float8", "bool"], + "keyvalues": [4.56, true] + } + - } + } + ] + } { + - "change": [ + "change": [ + ] + } -(10 rows) +(4 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 8d2d1693a147..6dd43ab56c0c 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -7,4 +7,10 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +-- By default don't write in chunks +CREATE TABLE x (); +DROP TABLE x; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', 'f'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'f', 'write-in-chunks', 't'); + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 363a2cff8b37..bc0a69ca6207 100644 --- a/wal2json.c +++ b/wal2json.c @@ -105,7 +105,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_schemas = true; data->include_types = true; data->pretty_print = false; - data->write_in_chunks = true; + data->write_in_chunks = false; data->include_lsn = false; data->nr_changes = 0; From ecf027994a283043ff8f4cfbf77b736a08261bc9 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 9 May 2017 02:39:46 +0100 Subject: [PATCH 024/154] Default for include-xids changed to false --- README.md | 4 ---- expected/cmdline.out | 21 +++++++++++++++++++++ sql/cmdline.sql | 9 +++++++++ wal2json.c | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a0c0840a83cf..316fe0c7e7f7 100644 --- a/README.md +++ b/README.md @@ -121,19 +121,16 @@ The output in the first terminal is: ``` { - "xid": 34225, "change": [ ] } { - "xid": 34226, "change": [ ] } WARNING: table "table_without_pk" without primary key or replica identity is nothing CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/126E5F70 { - "xid": 34227, "change": [ { "kind": "insert", @@ -241,7 +238,6 @@ COMMIT psql:/tmp/example2.sql:17: WARNING: table "table_without_pk" without primary key or replica identity is nothing CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/12713E40 { - "xid": 34232, "change": [ { "kind": "insert", diff --git a/expected/cmdline.out b/expected/cmdline.out index ebd0e7c58479..3ee1701821eb 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -28,6 +28,27 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc ]} (4 rows) +-- By default don't write xids +CREATE TABLE gimmexid (id integer PRIMARY KEY); +INSERT INTO gimmexid values (1); +DROP TABLE gimmexid; +SELECT max(((data::json) -> 'xid')::text::int) < txid_current() FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + ?column? +---------- + t +(1 row) + +SELECT max(((data::json) -> 'xid')::text::int) + 10 > txid_current() FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + ?column? +---------- + t +(1 row) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL) where ((data::json) -> 'xid') IS NOT NULL; + data +------ +(0 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 6dd43ab56c0c..1020a7c356cc 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -13,4 +13,13 @@ DROP TABLE x; SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', 'f'); SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'f', 'write-in-chunks', 't'); +-- By default don't write xids +CREATE TABLE gimmexid (id integer PRIMARY KEY); +INSERT INTO gimmexid values (1); +DROP TABLE gimmexid; +SELECT max(((data::json) -> 'xid')::text::int) < txid_current() FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT max(((data::json) -> 'xid')::text::int) + 10 > txid_current() FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL) where ((data::json) -> 'xid') IS NOT NULL; + + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index bc0a69ca6207..74bd05a3dc9b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -100,7 +100,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); - data->include_xids = true; + data->include_xids = false; data->include_timestamp = false; data->include_schemas = true; data->include_types = true; From 38038989e14270a52e07b595ffa5bf7b7466bec3 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 8 May 2017 23:47:13 -0300 Subject: [PATCH 025/154] style fix --- wal2json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wal2json.c b/wal2json.c index 363a2cff8b37..5fc13f785185 100644 --- a/wal2json.c +++ b/wal2json.c @@ -213,11 +213,13 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is strVal(elem->arg), elem->defname))); } else + { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("option \"%s\" = \"%s\" is unknown", elem->defname, elem->arg ? strVal(elem->arg) : "(null)"))); + } } } From a9c7af0340926f5bd817756d757ae571c6b9768a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 8 May 2017 23:49:45 -0300 Subject: [PATCH 026/154] Update copyright year information --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 980bded54e78..a22c3c4b2265 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2015, Euler Taveira de Oliveira +Copyright (c) 2013-2017, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index a0c0840a83cf..e991bcfb6857 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ stop License ======= -> Copyright (c) 2013-2015, Euler Taveira de Oliveira +> Copyright (c) 2013-2017, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index 5fc13f785185..31b3c6737980 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013, PostgreSQL Global Development Group + * Copyright (c) 2013-2017, PostgreSQL Global Development Group * * IDENTIFICATION * contrib/wal2json/wal2json.c From 8a99319aa8c53d3ec7c7147381245c1a9fcb54b4 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 9 May 2017 02:42:06 +0100 Subject: [PATCH 027/154] Dropped include-xids=0 from test suite --- expected/bytea.out | 2 +- expected/delete1.out | 2 +- expected/delete2.out | 2 +- expected/delete3.out | 2 +- expected/delete4.out | 2 +- expected/insert1.out | 2 +- expected/savepoint.out | 2 +- expected/specialvalue.out | 2 +- expected/toast.out | 2 +- expected/update1.out | 2 +- expected/update2.out | 2 +- expected/update3.out | 2 +- expected/update4.out | 2 +- sql/bytea.sql | 2 +- sql/delete1.sql | 2 +- sql/delete2.sql | 2 +- sql/delete3.sql | 2 +- sql/delete4.sql | 2 +- sql/insert1.sql | 2 +- sql/savepoint.sql | 2 +- sql/specialvalue.sql | 2 +- sql/toast.sql | 2 +- sql/update1.sql | 2 +- sql/update2.sql | 2 +- sql/update3.sql | 2 +- sql/update4.sql | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index cfdbdf7fd4cf..599189f953cb 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -22,7 +22,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/expected/delete1.out b/expected/delete1.out index d1184a55edf7..9daee0da15ca 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -76,7 +76,7 @@ DELETE FROM table_without_pk WHERE b = 1; DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/delete2.out b/expected/delete2.out index 0a4f49c0615c..752b8bfc5be2 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/delete3.out b/expected/delete3.out index 1919933b914f..2cae9df5f6b9 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -82,7 +82,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/delete4.out b/expected/delete4.out index 063a7b71d2d7..5059cdff93b5 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -35,7 +35,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data ----------------------------------------------------------------- { + diff --git a/expected/insert1.out b/expected/insert1.out index 26d6dae0245a..6ee618aa08ba 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -71,7 +71,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/savepoint.out b/expected/savepoint.out index bd4c034ab367..4790391966a4 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -23,7 +23,7 @@ ROLLBACK TO SAVEPOINT sp2; RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data ---------------------------------------------------------- { + diff --git a/expected/specialvalue.out b/expected/specialvalue.out index ba2f63b3f1f1..ad0c94a86086 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -17,7 +17,7 @@ INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data -------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/toast.out b/expected/toast.out index 53792cb683e3..d9676463f012 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -29,7 +29,7 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: column "toasted_col2" has an unchanged TOAST WARNING: column "toasted_col1" has an unchanged TOAST WARNING: column "toasted_col2" has an unchanged TOAST diff --git a/expected/update1.out b/expected/update1.out index 9a3a2334ff29..510784c9dfd7 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -78,7 +78,7 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/update2.out b/expected/update2.out index 15ad68687574..d945780c3c53 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/update3.out b/expected/update3.out index cfe3476add14..afdd698a34a6 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update4.out b/expected/update4.out index e3ad19e5dc8b..2a84c15e4c29 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -36,7 +36,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/sql/bytea.sql b/sql/bytea.sql index 1d0b79d58aed..85c7fcba3936 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -18,5 +18,5 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete1.sql b/sql/delete1.sql index cdd056cdf0f7..947689bcca1d 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -82,5 +82,5 @@ DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql index 2ae89163ae7c..e8e6aa12b0b0 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql index b7ae61c48e64..b4029dca182a 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -88,5 +88,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql index 190e45f051e8..2e27c6376709 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -37,5 +37,5 @@ DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql index 9a14cc3b4552..e4d36eccf2ca 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -74,5 +74,5 @@ INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUE INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql index eec0480e1e38..3df3950f9595 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -24,5 +24,5 @@ RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index 6266337e9cd7..f44165164ae9 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -17,5 +17,5 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index 6bb192ca349d..0d1ed2ff40a1 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -29,5 +29,5 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql index 48129555bdde..2e6663f0e817 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -85,5 +85,5 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql index 55903863ef4a..fc92d789623b 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql index 506671195c22..b689dffc2428 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql index 19a939e271b1..ad094d2deacf 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -38,5 +38,5 @@ UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); From ea2b35abad0793ffc53820f027a5ed61c774c99b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 9 May 2017 20:13:39 -0300 Subject: [PATCH 028/154] Avoid leaking memory when we have some can-not-happen situations --- wal2json.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wal2json.c b/wal2json.c index 31b3c6737980..b5fe4a8fbee0 100644 --- a/wal2json.c +++ b/wal2json.c @@ -675,6 +675,8 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (change->data.tp.newtuple == NULL) { elog(WARNING, "no tuple data for INSERT in table \"%s\"", NameStr(class_form->relname)); + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; } break; @@ -688,12 +690,16 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { /* FIXME this sentence is imprecise */ elog(WARNING, "table \"%s\" without primary key or replica identity is nothing", NameStr(class_form->relname)); + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; } if (change->data.tp.newtuple == NULL) { elog(WARNING, "no tuple data for UPDATE in table \"%s\"", NameStr(class_form->relname)); + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; } break; @@ -707,12 +713,16 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { /* FIXME this sentence is imprecise */ elog(WARNING, "table \"%s\" without primary key or replica identity is nothing", NameStr(class_form->relname)); + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; } if (change->data.tp.oldtuple == NULL) { elog(WARNING, "no tuple data for DELETE in table \"%s\"", NameStr(class_form->relname)); + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; } break; From badf1996b41c68b381c71a8f44ecf275358e1404 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 9 May 2017 20:28:29 -0300 Subject: [PATCH 029/154] Fix LICENSE Forgot to replace organization. --- LICENSE | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index a22c3c4b2265..68d0504d6d4f 100644 --- a/LICENSE +++ b/LICENSE @@ -11,7 +11,7 @@ are permitted provided that the following conditions are met: list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of the {organization} nor the names of its +* Neither the name of the Euler Taveira de Oliveira nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/README.md b/README.md index e991bcfb6857..133944d9f0f2 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,6 @@ License > Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -> Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +> Neither the name of the Euler Taveira de Oliveira nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From d2d5009b2197274ec568fad24a8768dbe37efe05 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 9 May 2017 23:55:16 -0300 Subject: [PATCH 030/154] Use '1' and '0' instead of 't' and 'f' on tests --- expected/cmdline.out | 4 ++-- sql/cmdline.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/expected/cmdline.out b/expected/cmdline.out index 3ee1701821eb..26e42e8f554d 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -12,14 +12,14 @@ ERROR: option "nosuchopt" = "42" is unknown -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', 'f'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0'); data --------------- {"change":[]} {"change":[]} (2 rows) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'f', 'write-in-chunks', 't'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'write-in-chunks', '1'); data ------------- {"change":[ diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 1020a7c356cc..37179843284f 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -10,8 +10,8 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nos -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', 'f'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', 'f', 'write-in-chunks', 't'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'write-in-chunks', '1'); -- By default don't write xids CREATE TABLE gimmexid (id integer PRIMARY KEY); From 2828409a5545083f91ebf6a3e1264eaf240efa46 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 10 May 2017 09:57:24 -0300 Subject: [PATCH 031/154] Forgot to add some static on functions Daniele Varrazzo --- wal2json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wal2json.c b/wal2json.c index 19aafa22d68f..285eecf387df 100644 --- a/wal2json.c +++ b/wal2json.c @@ -88,7 +88,7 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb) } /* Initialize this plugin */ -void +static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is_init) { ListCell *option; @@ -234,7 +234,7 @@ pg_decode_shutdown(LogicalDecodingContext *ctx) } /* BEGIN callback */ -void +static void pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { JsonDecodingData *data = ctx->output_plugin_private; @@ -287,7 +287,7 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) } /* COMMIT callback */ -void +static void pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn) { @@ -641,7 +641,7 @@ identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple } /* Callback for individual changed tuples */ -void +static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change) { From 645ab69aae268a81c900671b5dfab7029384e9ff Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 22 Aug 2017 19:51:06 -0300 Subject: [PATCH 032/154] Support generic WAL messages for logical decoding This feature allows software to insert data into WAL stream that can be read by wal2json. Those messages could be useful to control replication, for example. Messages can be sent as transactional or not. Non-transactional messages mean that it is sent even if the transaction is rollbacked. There was a PR #20 for this same feature but I didn't use it. Indeed, this code was dusty in my computer for a few months. NOTE: 'message' test will fail on <= 9.5 because this feature was coded in 9.6 (I don't want to complicate Makefile). --- Makefile | 3 +- expected/message.out | 122 +++++++++++++++++++++++++++++++++++++++++ sql/message.sql | 24 +++++++++ wal2json.c | 125 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 expected/message.out create mode 100644 sql/message.sql diff --git a/Makefile b/Makefile index ee71f1dd1ab1..c82b478c8af8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ MODULES = wal2json +# message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ - delete3 delete4 savepoint specialvalue toast bytea + delete3 delete4 savepoint specialvalue toast bytea message PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/message.out b/expected/message.out new file mode 100644 index 000000000000..1e83fbeaf569 --- /dev/null +++ b/expected/message.out @@ -0,0 +1,122 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +SELECT 'msg1' FROM pg_logical_emit_message(true, 'wal2json', 'this is a\ message'); + ?column? +---------- + msg1 +(1 row) + +SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" message'); + ?column? +---------- + msg2 +(1 row) + +BEGIN; +SELECT 'msg3' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); + ?column? +---------- + msg3 +(1 row) + +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); + ?column? +---------- + msg4 +(1 row) + +ROLLBACK; +BEGIN; +SELECT 'msg5' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); + ?column? +---------- + msg5 +(1 row) + +SELECT 'msg6' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); + ?column? +---------- + msg6 +(1 row) + +SELECT 'msg7' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); + ?column? +---------- + msg7 +(1 row) + +COMMIT; +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); + data +--------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "message", + + "transactional": true, + + "prefix": "wal2json", + + "content": "this is a\ message" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "this is "another" message" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "this message will be printed even if the transaction is rollbacked"+ + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "this message will be printed before message #1" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": true, + + "prefix": "wal2json", + + "content": "this is message #1" + + } + + ,{ + + "kind": "message", + + "transactional": true, + + "prefix": "wal2json", + + "content": "this is message #2" + + } + + ] + + } +(5 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/message.sql b/sql/message.sql new file mode 100644 index 000000000000..a376bd7b58ae --- /dev/null +++ b/sql/message.sql @@ -0,0 +1,24 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +SELECT 'msg1' FROM pg_logical_emit_message(true, 'wal2json', 'this is a\ message'); +SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" message'); + +BEGIN; +SELECT 'msg3' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); +ROLLBACK; + +BEGIN; +SELECT 'msg5' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); +SELECT 'msg6' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); +SELECT 'msg7' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); +COMMIT; + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 285eecf387df..88c77cfd7bee 100644 --- a/wal2json.c +++ b/wal2json.c @@ -22,6 +22,9 @@ #include "replication/output_plugin.h" #include "replication/logical.h" +#if PG_VERSION_NUM >= 90600 +#include "replication/message.h" +#endif #include "utils/builtins.h" #include "utils/lsyscache.h" @@ -68,6 +71,12 @@ static void pg_decode_commit_txn(LogicalDecodingContext *ctx, static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); +#if PG_VERSION_NUM >= 90600 +static void pg_decode_message(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr lsn, + bool transactional, const char *prefix, + Size content_size, const char *content); +#endif void _PG_init(void) @@ -85,6 +94,9 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb) cb->change_cb = pg_decode_change; cb->commit_cb = pg_decode_commit_txn; cb->shutdown_cb = pg_decode_shutdown; +#if PG_VERSION_NUM >= 90600 + cb->message_cb = pg_decode_message; +#endif } /* Initialize this plugin */ @@ -869,3 +881,116 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->write_in_chunks) OutputPluginWrite(ctx, true); } + +#if PG_VERSION_NUM >= 90600 +/* Callback for generic logical decoding messages */ +static void +pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr lsn, bool transactional, const char *prefix, Size + content_size, const char *content) +{ + JsonDecodingData *data; + MemoryContext old; + + data = ctx->output_plugin_private; + + /* Avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + /* + * write immediately iif (i) write-in-chunks=1 or (ii) non-transactional + * messages. + */ + if (data->write_in_chunks || !transactional) + OutputPluginPrepareWrite(ctx, true); + + /* + * increment counter only for transactional messages because + * non-transactional message has only one object. + */ + if (transactional) + data->nr_changes++; + + if (data->pretty_print) + { + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks && transactional) + appendStringInfoChar(ctx->out, '\n'); + + /* build a complete JSON object for non-transactional message */ + if (!transactional) + { + appendStringInfoString(ctx->out, "{\n"); + appendStringInfoString(ctx->out, "\t\"change\": [\n"); + } + + appendStringInfoString(ctx->out, "\t\t"); + + if (data->nr_changes > 1) + appendStringInfoChar(ctx->out, ','); + + appendStringInfoString(ctx->out, "{\n"); + + appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"message\",\n"); + + if (transactional) + appendStringInfoString(ctx->out, "\t\t\t\"transactional\": true,\n"); + else + appendStringInfoString(ctx->out, "\t\t\t\"transactional\": false,\n"); + + appendStringInfo(ctx->out, "\t\t\t\"prefix\": \"%s\",\n", prefix); + appendStringInfoString(ctx->out, "\t\t\t\"content\": \""); + appendBinaryStringInfo(ctx->out, content, content_size); + appendStringInfoString(ctx->out, "\"\n"); + appendStringInfoString(ctx->out, "\t\t}"); + + /* build a complete JSON object for non-transactional message */ + if (!transactional) + { + appendStringInfoString(ctx->out, "\n\t]"); + appendStringInfoString(ctx->out, "\n}"); + } + } + else + { + /* build a complete JSON object for non-transactional message */ + if (!transactional) + { + appendStringInfoString(ctx->out, "{"); + appendStringInfoString(ctx->out, "\"change\":["); + } + + if (data->nr_changes > 1) + appendStringInfoString(ctx->out, ",{"); + else + appendStringInfoChar(ctx->out, '{'); + + appendStringInfoString(ctx->out, "\"kind\":\"message\","); + + if (transactional) + appendStringInfoString(ctx->out, "\"transactional\":true,"); + else + appendStringInfoString(ctx->out, "\"transactional\":false,"); + + appendStringInfo(ctx->out, "\"prefix\":"); + quote_escape_json(ctx->out, prefix); + appendStringInfoChar(ctx->out, ','); + appendStringInfoString(ctx->out, "\"content\":"); + quote_escape_json(ctx->out, content); + appendStringInfoChar(ctx->out, '}'); + + /* build a complete JSON object for non-transactional message */ + if (!transactional) + { + appendStringInfoChar(ctx->out, ']'); + appendStringInfoChar(ctx->out, '}'); + } + } + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + + if (data->write_in_chunks || !transactional) + OutputPluginWrite(ctx, true); +} +#endif From c196c32b57d65db5913c76e8dec82b12fae79111 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 11 Oct 2017 11:42:34 -0300 Subject: [PATCH 033/154] Fix generic WAL messages As spotted in issue #28, I committed a code that was not supposed to be part of the original commit 645ab69aae268a81c900671b5dfab7029384e9ff. Thanks to Julien Rouhaud (@rjuju) to bring it up. --- wal2json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wal2json.c b/wal2json.c index 88c77cfd7bee..98a91e619c8a 100644 --- a/wal2json.c +++ b/wal2json.c @@ -972,11 +972,11 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, else appendStringInfoString(ctx->out, "\"transactional\":false,"); - appendStringInfo(ctx->out, "\"prefix\":"); - quote_escape_json(ctx->out, prefix); + appendStringInfo(ctx->out, "\"prefix\":\"%s\"", prefix); appendStringInfoChar(ctx->out, ','); - appendStringInfoString(ctx->out, "\"content\":"); - quote_escape_json(ctx->out, content); + appendStringInfoString(ctx->out, "\"content\":\""); + appendBinaryStringInfo(ctx->out, content, content_size); + appendStringInfoChar(ctx->out, '"'); appendStringInfoChar(ctx->out, '}'); /* build a complete JSON object for non-transactional message */ From 0255f2ac6b29ad799e6fa5bf6ddb98a741c6dce8 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 21 Oct 2017 09:12:40 -0300 Subject: [PATCH 034/154] Support type name with modifier Issue #31 asked for type name with type modifier (if available). This commit implemented type modifier inclusion by default. It is possible to use the old type name, if you use the option 'include-typmod' as 'false'. I'll change the regression tests to use the new format later. I've added a new test (typmod) to exercise this new option. --- Makefile | 2 +- expected/bytea.out | 2 +- expected/delete1.out | 2 +- expected/delete2.out | 2 +- expected/delete3.out | 2 +- expected/delete4.out | 2 +- expected/insert1.out | 2 +- expected/savepoint.out | 2 +- expected/specialvalue.out | 2 +- expected/toast.out | 2 +- expected/typmod.out | 135 ++++++++++++++++++++++++++++++++++++++ expected/update1.out | 2 +- expected/update2.out | 2 +- expected/update3.out | 2 +- expected/update4.out | 2 +- sql/bytea.sql | 2 +- sql/delete1.sql | 2 +- sql/delete2.sql | 2 +- sql/delete3.sql | 2 +- sql/delete4.sql | 2 +- sql/insert1.sql | 2 +- sql/savepoint.sql | 2 +- sql/specialvalue.sql | 2 +- sql/toast.sql | 2 +- sql/typmod.sql | 39 +++++++++++ sql/update1.sql | 2 +- sql/update2.sql | 2 +- sql/update3.sql | 2 +- sql/update4.sql | 2 +- wal2json.c | 33 +++++++++- 30 files changed, 231 insertions(+), 30 deletions(-) create mode 100644 expected/typmod.out create mode 100644 sql/typmod.sql diff --git a/Makefile b/Makefile index c82b478c8af8..5c24d344f4a1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ - delete3 delete4 savepoint specialvalue toast bytea message + delete3 delete4 savepoint specialvalue toast bytea message typmod PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/bytea.out b/expected/bytea.out index 599189f953cb..e40b91028181 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -22,7 +22,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/expected/delete1.out b/expected/delete1.out index 9daee0da15ca..db93d327aa45 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -76,7 +76,7 @@ DELETE FROM table_without_pk WHERE b = 1; DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/delete2.out b/expected/delete2.out index 752b8bfc5be2..338b711b53e3 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/delete3.out b/expected/delete3.out index 2cae9df5f6b9..9824f15ba378 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -82,7 +82,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/delete4.out b/expected/delete4.out index 5059cdff93b5..5d0bbfe9f206 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -35,7 +35,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data ----------------------------------------------------------------- { + diff --git a/expected/insert1.out b/expected/insert1.out index 6ee618aa08ba..9fc6870d365d 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -71,7 +71,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/savepoint.out b/expected/savepoint.out index 4790391966a4..241449a6af8d 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -23,7 +23,7 @@ ROLLBACK TO SAVEPOINT sp2; RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------- { + diff --git a/expected/specialvalue.out b/expected/specialvalue.out index ad0c94a86086..7916ec1a35a7 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -17,7 +17,7 @@ INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data -------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/toast.out b/expected/toast.out index d9676463f012..baa43fbb19dc 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -29,7 +29,7 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: column "toasted_col2" has an unchanged TOAST WARNING: column "toasted_col1" has an unchanged TOAST WARNING: column "toasted_col2" has an unchanged TOAST diff --git a/expected/typmod.out b/expected/typmod.out new file mode 100644 index 000000000000..82473fa70cde --- /dev/null +++ b/expected/typmod.out @@ -0,0 +1,135 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS table_with_pk; +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +UPDATE table_with_pk SET f = -f WHERE b = 1; +-- UPDATE: pk change +DELETE FROM table_with_pk WHERE b = 1; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["smallint", "integer", "bigint"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_pk", + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["smallint", "integer", "bigint"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } +(3 rows) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "table_with_pk", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"],+ + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "table_with_pk", + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } +(3 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/expected/update1.out b/expected/update1.out index 510784c9dfd7..e9b2140cfe88 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -78,7 +78,7 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data diff --git a/expected/update2.out b/expected/update2.out index d945780c3c53..e30c337ac0c9 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing diff --git a/expected/update3.out b/expected/update3.out index afdd698a34a6..9cf2a6f278b3 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update4.out b/expected/update4.out index 2a84c15e4c29..957f5d69e09a 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -36,7 +36,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/sql/bytea.sql b/sql/bytea.sql index 85c7fcba3936..157fc38dcc20 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -18,5 +18,5 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete1.sql b/sql/delete1.sql index 947689bcca1d..1bc2c84ba969 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -82,5 +82,5 @@ DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql index e8e6aa12b0b0..c8aa76f1e955 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql index b4029dca182a..f32f969843f9 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -88,5 +88,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql index 2e27c6376709..f4492b1e6cd6 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -37,5 +37,5 @@ DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql index e4d36eccf2ca..d849ff062a30 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -74,5 +74,5 @@ INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUE INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql index 3df3950f9595..9fd5a2a1ee3b 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -24,5 +24,5 @@ RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index f44165164ae9..b23c249a73d1 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -17,5 +17,5 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index 0d1ed2ff40a1..1bcede60fc0e 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -29,5 +29,5 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/typmod.sql b/sql/typmod.sql new file mode 100644 index 000000000000..33b323709062 --- /dev/null +++ b/sql/typmod.sql @@ -0,0 +1,39 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS table_with_pk; + +CREATE TABLE table_with_pk ( +a smallserial, +b smallint, +c int, +d bigint, +e numeric(5,3), +f real not null, +g double precision, +h char(10), +i varchar(30), +j text, +k bit varying(20), +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +UPDATE table_with_pk SET f = -f WHERE b = 1; + +-- UPDATE: pk change +DELETE FROM table_with_pk WHERE b = 1; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql index 2e6663f0e817..83485ad142df 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -85,5 +85,5 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql index fc92d789623b..f1ce1ce0eb56 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql index b689dffc2428..d28054ed10bd 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -86,5 +86,5 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql index ad094d2deacf..9c77162219f4 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -38,5 +38,5 @@ UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 98a91e619c8a..b5bf3f80e556 100644 --- a/wal2json.c +++ b/wal2json.c @@ -47,6 +47,7 @@ typedef struct bool include_timestamp; /* include transaction timestamp */ bool include_schemas; /* qualify tables */ bool include_types; /* include data types */ + bool include_typmod; /* include typmod in types */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -116,6 +117,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_timestamp = false; data->include_schemas = true; data->include_types = true; + data->include_typmod = true; data->pretty_print = false; data->write_in_chunks = false; data->include_lsn = false; @@ -185,6 +187,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-typmod") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-typmod argument is null"); + data->include_typmod = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_typmod)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "pretty-print") == 0) { if (elem->arg == NULL) @@ -451,7 +466,6 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu Form_pg_attribute attr; /* the attribute itself */ Oid typid; /* type of current attribute */ HeapTuple type_tuple; /* information about a type */ - Form_pg_type type_form; Oid typoutput; /* output function */ bool typisvarlena; Datum origval; /* possibly toasted Datum */ @@ -490,7 +504,6 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); if (!HeapTupleIsValid(type_tuple)) elog(ERROR, "cache lookup failed for type %u", typid); - type_form = (Form_pg_type) GETSTRUCT(type_tuple); /* Get information needed for printing values of a type */ getTypeOutputInfo(typid, &typoutput, &typisvarlena); @@ -513,7 +526,21 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&colnames, "%s\"%s\"", comma, NameStr(attr->attname)); if (data->include_types) - appendStringInfo(&coltypes, "%s\"%s\"", comma, NameStr(type_form->typname)); + { + if (data->include_typmod) + { + char *type_str; + + type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); + appendStringInfo(&coltypes, "%s\"%s\"", comma, type_str); + pfree(type_str); + } + else + { + Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); + appendStringInfo(&coltypes, "%s\"%s\"", comma, NameStr(type_form->typname)); + } + } ReleaseSysCache(type_tuple); From dc7511276ba626a6120992682f46e04dbd4a2ae3 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 31 Aug 2017 17:33:03 -0300 Subject: [PATCH 035/154] Fix a description --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index b5bf3f80e556..7e1b84503ffa 100644 --- a/wal2json.c +++ b/wal2json.c @@ -109,7 +109,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data = palloc0(sizeof(JsonDecodingData)); data->context = AllocSetContextCreate(TopMemoryContext, - "text conversion context", + "wal2json output context", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); From cbbdda966bac741c6bc194940727bfd1a9d104d7 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 21 Oct 2017 21:03:19 -0300 Subject: [PATCH 036/154] Remove superfluous includes rel.h includes pg_class.h, index.h, and relcache.h. logical.h includes output_plugin.h. All of the others are not necessary. --- wal2json.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/wal2json.c b/wal2json.c index 7e1b84503ffa..cdbcde17757b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -12,28 +12,16 @@ */ #include "postgres.h" -#include "access/sysattr.h" - -#include "catalog/pg_class.h" #include "catalog/pg_type.h" -#include "catalog/index.h" - -#include "nodes/parsenodes.h" -#include "replication/output_plugin.h" #include "replication/logical.h" -#if PG_VERSION_NUM >= 90600 -#include "replication/message.h" -#endif #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/pg_lsn.h" #include "utils/rel.h" -#include "utils/relcache.h" #include "utils/syscache.h" -#include "utils/typcache.h" PG_MODULE_MAGIC; From 5352cc4193b956be446d6f5f21dd5282c463118b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 9 Nov 2017 02:02:32 +0000 Subject: [PATCH 037/154] TupleDescAttr() support Commit d34a74dd064af959acd9040446925d9d53dff15b introduced TupleDescAttr(tupdesc, i) in back branches (9.4.14, 9.5.9, 9.6.5, 10). If the version supports it, use this macro. This change will unbreak (future) version 11. --- wal2json.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index cdbcde17757b..75a421f8b98b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -461,7 +461,16 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu char *outputstr = NULL; bool isnull; /* column is null? */ + /* + * Commit d34a74dd064af959acd9040446925d9d53dff15b introduced + * TupleDescAttr() in back branches. If the version supports + * this macro, use it. Version 10 and later already support it. + */ +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) attr = tupdesc->attrs[natt]; +#else + attr = TupleDescAttr(tupdesc, natt); +#endif elog(DEBUG1, "attribute \"%s\" (%d/%d)", NameStr(attr->attname), natt, tupdesc->natts); @@ -477,8 +486,18 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu for (j = 0; j < indexdesc->natts; j++) { - if (strcmp(NameStr(attr->attname), NameStr(indexdesc->attrs[j]->attname)) == 0) + Form_pg_attribute iattr; + + /* See explanation a few lines above. */ +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) + iattr = indexdesc->attrs[j]; +#else + iattr = TupleDescAttr(indexdesc, j); +#endif + + if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) found_col = true; + } /* Print only indexed columns */ From 27cd71a61712da23a41fa833b00d14d3d1ecb156 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 19 Nov 2017 20:00:11 -0200 Subject: [PATCH 038/154] Support type oids Issue #37 asked for type oids in the output because psycopg2 uses it directly for internal type manipulation. Although @lionel-panhaleux had provided PR #38, I didn't like the way it was implemented mainly because it mixes options. The new option 'include-type-oids' has default to false. I didn't provide tests for this feature. --- wal2json.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/wal2json.c b/wal2json.c index 75a421f8b98b..791cd6982600 100644 --- a/wal2json.c +++ b/wal2json.c @@ -35,6 +35,7 @@ typedef struct bool include_timestamp; /* include transaction timestamp */ bool include_schemas; /* qualify tables */ bool include_types; /* include data types */ + bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ bool pretty_print; /* pretty-print JSON? */ @@ -105,6 +106,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_timestamp = false; data->include_schemas = true; data->include_types = true; + data->include_type_oids = false; data->include_typmod = true; data->pretty_print = false; data->write_in_chunks = false; @@ -175,6 +177,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-type-oids") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-type-oids argument is null"); + data->include_type_oids = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_type_oids)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-typmod") == 0) { if (elem->arg == NULL) @@ -401,15 +416,18 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu StringInfoData colnames; StringInfoData coltypes; + StringInfoData coltypeoids; StringInfoData colvalues; char *comma = ""; + data = ctx->output_plugin_private; + initStringInfo(&colnames); initStringInfo(&coltypes); + if (data->include_type_oids) + initStringInfo(&coltypeoids); initStringInfo(&colvalues); - data = ctx->output_plugin_private; - /* * If replident is true, it will output info about replica identity. In this * case, there are special JSON objects for it. Otherwise, it will print new @@ -422,6 +440,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "\t\t\t\"oldkeys\": {\n"); appendStringInfoString(&colnames, "\t\t\t\t\"keynames\": ["); appendStringInfoString(&coltypes, "\t\t\t\t\"keytypes\": ["); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "\t\t\t\"keytypeoids\": ["); appendStringInfoString(&colvalues, "\t\t\t\t\"keyvalues\": ["); } else @@ -429,6 +449,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "\"oldkeys\":{"); appendStringInfoString(&colnames, "\"keynames\":["); appendStringInfoString(&coltypes, "\"keytypes\":["); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "\"keytypeoids\": ["); appendStringInfoString(&colvalues, "\"keyvalues\":["); } } @@ -438,12 +460,16 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu { appendStringInfoString(&colnames, "\t\t\t\"columnnames\": ["); appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "\t\t\t\"columntypeoids\": ["); appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); } else { appendStringInfoString(&colnames, "\"columnnames\":["); appendStringInfoString(&coltypes, "\"columntypes\":["); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "\"columntypeoids\": ["); appendStringInfoString(&colvalues, "\"columnvalues\":["); } } @@ -549,6 +575,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu } } + if (data->include_type_oids) + appendStringInfo(&coltypeoids, "%s%u", comma, typid); + ReleaseSysCache(type_tuple); if (isnull) @@ -624,6 +653,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "],\n"); if (data->include_types) appendStringInfoString(&coltypes, "],\n"); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "],\n"); appendStringInfoString(&colvalues, "]\n"); appendStringInfoString(&colvalues, "\t\t\t}\n"); } @@ -632,6 +663,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "],"); if (data->include_types) appendStringInfoString(&coltypes, "],"); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "],"); appendStringInfoChar(&colvalues, ']'); appendStringInfoChar(&colvalues, '}'); } @@ -643,6 +676,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "],\n"); if (data->include_types) appendStringInfoString(&coltypes, "],\n"); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "],\n"); if (hasreplident) appendStringInfoString(&colvalues, "],\n"); else @@ -653,6 +688,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&colnames, "],"); if (data->include_types) appendStringInfoString(&coltypes, "],"); + if (data->include_type_oids) + appendStringInfoString(&coltypeoids, "],"); if (hasreplident) appendStringInfoString(&colvalues, "],"); else @@ -664,10 +701,14 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(ctx->out, colnames.data); if (data->include_types) appendStringInfoString(ctx->out, coltypes.data); + if (data->include_type_oids) + appendStringInfoString(ctx->out, coltypeoids.data); appendStringInfoString(ctx->out, colvalues.data); pfree(colnames.data); pfree(coltypes.data); + if (data->include_type_oids) + pfree(coltypeoids.data); pfree(colvalues.data); } From f68cb0096c669a2ee5a2d32b54a535513e3cb23b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 25 Nov 2017 23:30:50 -0200 Subject: [PATCH 039/154] Support not-null constraints information Issue #44 asked for not-null constraints information because the other side could benefit from this. The new option 'include-not-null' will add another name/value pair (columnoptionals) that contains false for not-null constraint (it means that the value is not optional) or true, otherwise. The default is false. --- expected/cmdline.out | 21 +++++++++++++++++++++ sql/cmdline.sql | 13 +++++++++++++ wal2json.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/expected/cmdline.out b/expected/cmdline.out index 26e42e8f554d..35d9295629d4 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -9,6 +9,27 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); ERROR: option "nosuchopt" = "42" is unknown +-- don't include not-null constraint by default +CREATE TABLE table_optional ( +a smallserial, +b integer, +c boolean not null, +PRIMARY KEY(a) +); +INSERT INTO table_optional (b, c) VALUES(NULL, TRUE); +UPDATE table_optional SET b = 123 WHERE a = 1; +DELETE FROM table_optional WHERE a = 1; +DROP TABLE table_optional; +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'include-not-null', '1'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals": [false,true,false],"columnvalues":[1,null,true]}]} + {"change":[{"kind":"update","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals": [false,true,false],"columnvalues":[1,123,true],"oldkeys":{"keynames":["a"],"keytypes":["smallint"],"keyvalues":[1]}}]} + {"change":[{"kind":"delete","schema":"public","table":"table_optional","oldkeys":{"keynames":["a"],"keytypes":["smallint"],"keyvalues":[1]}}]} + {"change":[]} +(5 rows) + -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 37179843284f..bab3673b6fed 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -7,6 +7,19 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +-- don't include not-null constraint by default +CREATE TABLE table_optional ( +a smallserial, +b integer, +c boolean not null, +PRIMARY KEY(a) +); +INSERT INTO table_optional (b, c) VALUES(NULL, TRUE); +UPDATE table_optional SET b = 123 WHERE a = 1; +DELETE FROM table_optional WHERE a = 1; +DROP TABLE table_optional; +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'include-not-null', '1'); + -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; diff --git a/wal2json.c b/wal2json.c index 791cd6982600..19eadcb4aea3 100644 --- a/wal2json.c +++ b/wal2json.c @@ -37,6 +37,7 @@ typedef struct bool include_types; /* include data types */ bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ + bool include_not_null; /* include not-null constraints */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -111,6 +112,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->pretty_print = false; data->write_in_chunks = false; data->include_lsn = false; + data->include_not_null = false; data->nr_changes = 0; @@ -203,6 +205,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-not-null") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-not-null argument is null"); + data->include_not_null = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_not_null)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "pretty-print") == 0) { if (elem->arg == NULL) @@ -417,6 +432,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu StringInfoData colnames; StringInfoData coltypes; StringInfoData coltypeoids; + StringInfoData colnotnulls; StringInfoData colvalues; char *comma = ""; @@ -426,6 +442,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu initStringInfo(&coltypes); if (data->include_type_oids) initStringInfo(&coltypeoids); + if (data->include_not_null) + initStringInfo(&colnotnulls); initStringInfo(&colvalues); /* @@ -462,6 +480,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); if (data->include_type_oids) appendStringInfoString(&coltypeoids, "\t\t\t\"columntypeoids\": ["); + if (data->include_not_null) + appendStringInfoString(&colnotnulls, "\t\t\t\"columnoptionals\": ["); appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); } else @@ -470,6 +490,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&coltypes, "\"columntypes\":["); if (data->include_type_oids) appendStringInfoString(&coltypeoids, "\"columntypeoids\": ["); + if (data->include_not_null) + appendStringInfoString(&colnotnulls, "\"columnoptionals\": ["); appendStringInfoString(&colvalues, "\"columnvalues\":["); } } @@ -573,6 +595,15 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); appendStringInfo(&coltypes, "%s\"%s\"", comma, NameStr(type_form->typname)); } + + /* oldkeys doesn't print not-null constraints */ + if (!replident && data->include_not_null) + { + if (attr->attnotnull) + appendStringInfo(&colnotnulls, "%sfalse", comma); + else + appendStringInfo(&colnotnulls, "%strue", comma); + } } if (data->include_type_oids) @@ -678,6 +709,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&coltypes, "],\n"); if (data->include_type_oids) appendStringInfoString(&coltypeoids, "],\n"); + if (data->include_not_null) + appendStringInfoString(&colnotnulls, "],\n"); if (hasreplident) appendStringInfoString(&colvalues, "],\n"); else @@ -690,6 +723,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&coltypes, "],"); if (data->include_type_oids) appendStringInfoString(&coltypeoids, "],"); + if (data->include_not_null) + appendStringInfoString(&colnotnulls, "],"); if (hasreplident) appendStringInfoString(&colvalues, "],"); else @@ -703,12 +738,16 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(ctx->out, coltypes.data); if (data->include_type_oids) appendStringInfoString(ctx->out, coltypeoids.data); + if (data->include_not_null) + appendStringInfoString(ctx->out, colnotnulls.data); appendStringInfoString(ctx->out, colvalues.data); pfree(colnames.data); pfree(coltypes.data); if (data->include_type_oids) pfree(coltypeoids.data); + if (data->include_not_null) + pfree(colnotnulls.data); pfree(colvalues.data); } From 003132b546ab95d0533e122665570411f5359eee Mon Sep 17 00:00:00 2001 From: Robert Coup Date: Thu, 16 Nov 2017 13:51:39 +0000 Subject: [PATCH 040/154] Improve JSON encoding: * use the postgres builtin escape_json() function * escape all type, schema, table, field names. Add tests. [#35] * leave `\x` alone unless it's a bytea prefix [#23] * escape generic logical decoding messages with tests --- expected/insert1.out | 15 ++++ expected/message.out | 70 ++++++++++++++++--- expected/specialvalue.out | 80 +++++++++++----------- sql/insert1.sql | 9 +++ sql/message.sql | 14 ++-- wal2json.c | 140 ++++++++++++++++---------------------- 6 files changed, 192 insertions(+), 136 deletions(-) diff --git a/expected/insert1.out b/expected/insert1.out index 9fc6870d365d..d568afbaf438 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -59,6 +59,12 @@ o json, p tsvector, UNIQUE(g, n) ); +CREATE SCHEMA "test ""schema"; +CREATE TABLE "test ""schema"."test "" with 'quotes'" ( + id serial primary key, + "col spaces" int, + "col""quotes" int +); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- @@ -70,6 +76,7 @@ BEGIN; INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO "test ""schema"."test "" with 'quotes'" VALUES (1, 2, 3); COMMIT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); data @@ -100,6 +107,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"]+ } + + ,{ + + "kind": "insert", + + "schema": "test \"schema", + + "table": "test \" with 'quotes'", + + "columnnames": ["id", "col spaces", "col\"quotes"], + + "columntypes": ["int4", "int4", "int4"], + + "columnvalues": [1, 2, 3] + + } + ] + } (1 row) diff --git a/expected/message.out b/expected/message.out index 1e83fbeaf569..bf664c9df3cd 100644 --- a/expected/message.out +++ b/expected/message.out @@ -19,39 +19,57 @@ SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" msg2 (1 row) -BEGIN; -SELECT 'msg3' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); +SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x31320033003435'::bytea); ?column? ---------- msg3 (1 row) -SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\xC0FFEE00C0FFEE'::bytea); ?column? ---------- msg4 (1 row) -ROLLBACK; -BEGIN; -SELECT 'msg5' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); +SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x01020300101112'::bytea); ?column? ---------- msg5 (1 row) -SELECT 'msg6' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); +BEGIN; +SELECT 'msg6' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); ?column? ---------- msg6 (1 row) -SELECT 'msg7' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); +SELECT 'msg7' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); ?column? ---------- msg7 (1 row) +ROLLBACK; +BEGIN; +SELECT 'msg8' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); + ?column? +---------- + msg8 +(1 row) + +SELECT 'msg9' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); + ?column? +---------- + msg9 +(1 row) + +SELECT 'msg10' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); + ?column? +---------- + msg10 +(1 row) + COMMIT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); data @@ -62,7 +80,37 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "kind": "message", + "transactional": true, + "prefix": "wal2json", + - "content": "this is a\ message" + + "content": "this is a\\ message" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "this is \"another\" message" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "12" + + } + + ] + + } + { + + "change": [ + + { + + "kind": "message", + + "transactional": false, + + "prefix": "wal2json", + + "content": "" + } + ] + } @@ -72,7 +120,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "kind": "message", + "transactional": false, + "prefix": "wal2json", + - "content": "this is "another" message" + + "content": "\u0001\u0002\u0003" + } + ] + } @@ -112,7 +160,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } + ] + } -(5 rows) +(8 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/expected/specialvalue.out b/expected/specialvalue.out index 7916ec1a35a7..fefcb3975d2d 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -18,47 +18,47 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); - data --------------------------------------------------------------------------------------------------------------------------- - { + - "change": [ + - ] + + data +------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["a", "b", "c", "d"], + - "columntypes": ["int4", "bool", "varchar", "float4"], + - "columnvalues": [1, true, "test1", null] + - } + - ,{ + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["a", "b", "c", "d"], + - "columntypes": ["int4", "bool", "varchar", "float4"], + - "columnvalues": [2, false, "test2", null] + - } + - ,{ + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["a", "b", "c", "d"], + - "columntypes": ["int4", "bool", "varchar", "float4"], + - "columnvalues": [3, null, "null", null] + - } + - ,{ + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["a", "b", "c", "d"], + - "columntypes": ["int4", "bool", "varchar", "float4"], + - "columnvalues": [4, true, "valid: ' \" \\ \/ \b \f \n \r \t ⁿ 陿 invalid: \\g \\k end", 123.456]+ - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [1, true, "test1", null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [2, false, "test2", null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [3, null, "null", null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["int4", "bool", "varchar", "float4"], + + "columnvalues": [4, true, "valid: ' \" \\ / \b \f \n \r \t ⁿ 陿 invalid: \\g \\k end", 123.456]+ + } + + ] + } (2 rows) diff --git a/sql/insert1.sql b/sql/insert1.sql index d849ff062a30..8d78dbb9dc7a 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -65,6 +65,14 @@ p tsvector, UNIQUE(g, n) ); +CREATE SCHEMA "test ""schema"; + +CREATE TABLE "test ""schema"."test "" with 'quotes'" ( + id serial primary key, + "col spaces" int, + "col""quotes" int +); + SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -- INSERT @@ -72,6 +80,7 @@ BEGIN; INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +INSERT INTO "test ""schema"."test "" with 'quotes'" VALUES (1, 2, 3); COMMIT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); diff --git a/sql/message.sql b/sql/message.sql index a376bd7b58ae..8df73db0e3f6 100644 --- a/sql/message.sql +++ b/sql/message.sql @@ -8,15 +8,19 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT 'msg1' FROM pg_logical_emit_message(true, 'wal2json', 'this is a\ message'); SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" message'); +SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x31320033003435'::bytea); +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\xC0FFEE00C0FFEE'::bytea); +SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x01020300101112'::bytea); + BEGIN; -SELECT 'msg3' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); -SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); +SELECT 'msg6' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); +SELECT 'msg7' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed even if the transaction is rollbacked'); ROLLBACK; BEGIN; -SELECT 'msg5' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); -SELECT 'msg6' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); -SELECT 'msg7' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); +SELECT 'msg8' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #1'); +SELECT 'msg9' FROM pg_logical_emit_message(false, 'wal2json', 'this message will be printed before message #1'); +SELECT 'msg10' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); COMMIT; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); diff --git a/wal2json.c b/wal2json.c index 19eadcb4aea3..e8884517d6bc 100644 --- a/wal2json.c +++ b/wal2json.c @@ -17,6 +17,7 @@ #include "replication/logical.h" #include "utils/builtins.h" +#include "utils/json.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/pg_lsn.h" @@ -292,7 +293,7 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->pretty_print) appendStringInfoString(ctx->out, "{\n"); else - appendStringInfoChar(ctx->out, '{'); + appendStringInfoCharMacro(ctx->out, '{'); if (data->include_xids) { @@ -353,7 +354,7 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { /* if we don't write in chunks, we need a newline here */ if (!data->write_in_chunks) - appendStringInfoChar(ctx->out, '\n'); + appendStringInfoCharMacro(ctx->out, '\n'); appendStringInfoString(ctx->out, "\t]\n}"); } @@ -365,57 +366,6 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, OutputPluginWrite(ctx, true); } -/* - * Format a string as a JSON literal - * XXX it doesn't do a sanity check for invalid input, does it? - * FIXME it doesn't handle \uxxxx - */ -static void -quote_escape_json(StringInfo buf, const char *val) -{ - const char *valptr; - - appendStringInfoChar(buf, '"'); - for (valptr = val; *valptr; valptr++) - { - char ch = *valptr; - - /* XXX suppress \x in bytea field? */ - if (ch == '\\' && *(valptr + 1) == 'x') - { - valptr++; - continue; - } - - switch (ch) - { - case '"': - case '\\': - case '/': - appendStringInfo(buf, "\\%c", ch); - break; - case '\b': - appendStringInfoString(buf, "\\b"); - break; - case '\f': - appendStringInfoString(buf, "\\f"); - break; - case '\n': - appendStringInfoString(buf, "\\n"); - break; - case '\r': - appendStringInfoString(buf, "\\r"); - break; - case '\t': - appendStringInfoString(buf, "\\t"); - break; - default: - appendStringInfoChar(buf, ch); - break; - } - } - appendStringInfoChar(buf, '"'); -} /* * Accumulate tuple information and stores it at the end @@ -578,7 +528,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu } /* Accumulate each column info */ - appendStringInfo(&colnames, "%s\"%s\"", comma, NameStr(attr->attname)); + appendStringInfoString(&colnames, comma); + escape_json(&colnames, NameStr(attr->attname)); if (data->include_types) { @@ -587,13 +538,15 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu char *type_str; type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); - appendStringInfo(&coltypes, "%s\"%s\"", comma, type_str); + appendStringInfoString(&coltypes, comma); + escape_json(&coltypes, type_str); pfree(type_str); } else { Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); - appendStringInfo(&coltypes, "%s\"%s\"", comma, NameStr(type_form->typname)); + appendStringInfoString(&coltypes, comma); + escape_json(&coltypes, NameStr(type_form->typname)); } /* oldkeys doesn't print not-null constraints */ @@ -659,9 +612,14 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu else appendStringInfo(&colvalues, "%sfalse", comma); break; + case BYTEAOID: + appendStringInfoString(&colvalues, comma); + // XXX: strings here are "\xC0FFEE", we strip the "\x" + escape_json(&colvalues, (outputstr+2)); + break; default: appendStringInfoString(&colvalues, comma); - quote_escape_json(&colvalues, outputstr); + escape_json(&colvalues, outputstr); break; } } @@ -696,8 +654,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(&coltypes, "],"); if (data->include_type_oids) appendStringInfoString(&coltypeoids, "],"); - appendStringInfoChar(&colvalues, ']'); - appendStringInfoChar(&colvalues, '}'); + appendStringInfoCharMacro(&colvalues, ']'); + appendStringInfoCharMacro(&colvalues, '}'); } } else @@ -728,7 +686,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (hasreplident) appendStringInfoString(&colvalues, "],"); else - appendStringInfoChar(&colvalues, ']'); + appendStringInfoCharMacro(&colvalues, ']'); } } @@ -878,7 +836,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->nr_changes > 1) appendStringInfoString(ctx->out, ",{"); else - appendStringInfoChar(ctx->out, '{'); + appendStringInfoCharMacro(ctx->out, '{'); } /* Print change kind */ @@ -910,14 +868,26 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->pretty_print) { if (data->include_schemas) - appendStringInfo(ctx->out, "\t\t\t\"schema\": \"%s\",\n", get_namespace_name(class_form->relnamespace)); - appendStringInfo(ctx->out, "\t\t\t\"table\": \"%s\",\n", NameStr(class_form->relname)); + { + appendStringInfoString(ctx->out, "\t\t\t\"schema\": "); + escape_json(ctx->out, get_namespace_name(class_form->relnamespace)); + appendStringInfoString(ctx->out, ",\n"); + } + appendStringInfoString(ctx->out, "\t\t\t\"table\": "); + escape_json(ctx->out, NameStr(class_form->relname)); + appendStringInfoString(ctx->out, ",\n"); } else { if (data->include_schemas) - appendStringInfo(ctx->out, "\"schema\":\"%s\",", get_namespace_name(class_form->relnamespace)); - appendStringInfo(ctx->out, "\"table\":\"%s\",", NameStr(class_form->relname)); + { + appendStringInfoString(ctx->out, "\"schema\":"); + escape_json(ctx->out, get_namespace_name(class_form->relnamespace)); + appendStringInfoCharMacro(ctx->out, ','); + } + appendStringInfoString(ctx->out, "\"table\":"); + escape_json(ctx->out, NameStr(class_form->relname)); + appendStringInfoCharMacro(ctx->out, ','); } switch (change->action) @@ -987,7 +957,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->pretty_print) appendStringInfoString(ctx->out, "\t\t}"); else - appendStringInfoChar(ctx->out, '}'); + appendStringInfoCharMacro(ctx->out, '}'); MemoryContextSwitchTo(old); MemoryContextReset(data->context); @@ -1005,6 +975,7 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data; MemoryContext old; + char *content_str; data = ctx->output_plugin_private; @@ -1052,11 +1023,17 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, else appendStringInfoString(ctx->out, "\t\t\t\"transactional\": false,\n"); - appendStringInfo(ctx->out, "\t\t\t\"prefix\": \"%s\",\n", prefix); - appendStringInfoString(ctx->out, "\t\t\t\"content\": \""); - appendBinaryStringInfo(ctx->out, content, content_size); - appendStringInfoString(ctx->out, "\"\n"); - appendStringInfoString(ctx->out, "\t\t}"); + appendStringInfo(ctx->out, "\t\t\t\"prefix\": "); + escape_json(ctx->out, prefix); + appendStringInfoString(ctx->out, ",\n\t\t\t\"content\": "); + + // force null-terminated string + content_str = (char *)palloc0(content_size+1); + strncpy(content_str, content, content_size); + escape_json(ctx->out, content_str); + pfree(content_str); + + appendStringInfoString(ctx->out, "\n\t\t}"); /* build a complete JSON object for non-transactional message */ if (!transactional) @@ -1070,8 +1047,7 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* build a complete JSON object for non-transactional message */ if (!transactional) { - appendStringInfoString(ctx->out, "{"); - appendStringInfoString(ctx->out, "\"change\":["); + appendStringInfoString(ctx->out, "{\"change\":["); } if (data->nr_changes > 1) @@ -1086,18 +1062,22 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, else appendStringInfoString(ctx->out, "\"transactional\":false,"); - appendStringInfo(ctx->out, "\"prefix\":\"%s\"", prefix); - appendStringInfoChar(ctx->out, ','); - appendStringInfoString(ctx->out, "\"content\":\""); - appendBinaryStringInfo(ctx->out, content, content_size); - appendStringInfoChar(ctx->out, '"'); + appendStringInfo(ctx->out, "\"prefix\":"); + escape_json(ctx->out, prefix); + appendStringInfoString(ctx->out, ",\"content\":"); + + // force null-terminated string + content_str = (char *)palloc0(content_size+1); + strncpy(content_str, content, content_size); + escape_json(ctx->out, content_str); + pfree(content_str); + appendStringInfoChar(ctx->out, '}'); /* build a complete JSON object for non-transactional message */ if (!transactional) { - appendStringInfoChar(ctx->out, ']'); - appendStringInfoChar(ctx->out, '}'); + appendStringInfoString(ctx->out, "]}"); } } From d7df8e17ec16e70fb90f3b41a45527424f8aa2b8 Mon Sep 17 00:00:00 2001 From: David Fetter Date: Sat, 17 Feb 2018 14:25:59 -0500 Subject: [PATCH 041/154] Update call to AllocSetContextCreate for PostgreSQL 9.6+ --- wal2json.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 19eadcb4aea3..a9cdd73678ca 100644 --- a/wal2json.c +++ b/wal2json.c @@ -100,9 +100,14 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data = palloc0(sizeof(JsonDecodingData)); data->context = AllocSetContextCreate(TopMemoryContext, "wal2json output context", +#if PG_VERSION_NUM >= 90600 + ALLOCSET_DEFAULT_SIZES +#else ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, - ALLOCSET_DEFAULT_MAXSIZE); + ALLOCSET_DEFAULT_MAXSIZE +#endif + ); data->include_xids = false; data->include_timestamp = false; data->include_schemas = true; From 409fcff4478743d161eb0358d26930773335767a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 25 Mar 2018 03:03:07 -0300 Subject: [PATCH 042/154] Filter out tables The new parameter 'filter-tables' is a comma separated value that contains schema.table elements. Both schema and table can be * that denotes all. Hence, *.table_1 means table_1 in all schemas and schema_1.* means all tables in schema_1. Some characters (space, single quote, comma, period, asterisk) have special treatment because they are part of the comma separated value. If any of these characters is part of the schema or table name, add a backslash (\) before it. For example, table public."foo bar" should be specified as 'public.foo\ bar'. --- Makefile | 3 +- expected/filtertable.out | 177 +++++++++++++++++++++++++++++++++ sql/filtertable.sql | 64 ++++++++++++ wal2json.c | 204 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 447 insertions(+), 1 deletion(-) create mode 100644 expected/filtertable.out create mode 100644 sql/filtertable.sql diff --git a/Makefile b/Makefile index 5c24d344f4a1..0816c7bc5612 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ - delete3 delete4 savepoint specialvalue toast bytea message typmod + delete3 delete4 savepoint specialvalue toast bytea message typmod \ + filtertable PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/filtertable.out b/expected/filtertable.out new file mode 100644 index 000000000000..e08b67584247 --- /dev/null +++ b/expected/filtertable.out @@ -0,0 +1,177 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS filter_table_1; +NOTICE: table "filter_table_1" does not exist, skipping +DROP TABLE IF EXISTS filter_table_2; +NOTICE: table "filter_table_2" does not exist, skipping +DROP TABLE IF EXISTS filter_table_3; +NOTICE: table "filter_table_3" does not exist, skipping +DROP TABLE IF EXISTS filter_table_4; +NOTICE: table "filter_table_4" does not exist, skipping +DROP TABLE IF EXISTS "Filter_table_5"; +NOTICE: table "Filter_table_5" does not exist, skipping +DROP TABLE IF EXISTS "filter table_6"; +NOTICE: table "filter table_6" does not exist, skipping +DROP TABLE IF EXISTS "filter.table_7"; +NOTICE: table "filter.table_7" does not exist, skipping +DROP TABLE IF EXISTS "filter,table_8"; +NOTICE: table "filter,table_8" does not exist, skipping +DROP TABLE IF EXISTS "filter""table_9"; +NOTICE: table "filter"table_9" does not exist, skipping +DROP TABLE IF EXISTS " filter_table_10"; +NOTICE: table " filter_table_10" does not exist, skipping +DROP TABLE IF EXISTS "*"; +NOTICE: table "*" does not exist, skipping +DROP SCHEMA IF EXISTS filter_schema_1 CASCADE; +NOTICE: schema "filter_schema_1" does not exist, skipping +DROP SCHEMA IF EXISTS filter_schema_2 CASCADE; +NOTICE: schema "filter_schema_2" does not exist, skipping +DROP SCHEMA IF EXISTS "*" CASCADE; +NOTICE: schema "*" does not exist, skipping +CREATE SCHEMA filter_schema_1; +CREATE SCHEMA filter_schema_2; +CREATE SCHEMA "*"; +CREATE TABLE filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_1.filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_1.filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_3 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_3 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_4 (a integer, b text, primary key(a)); +CREATE TABLE "Filter_table_5" (a integer, b text, primary key(a)); +CREATE TABLE "filter table_6" (a integer, b text, primary key(a)); +CREATE TABLE "filter.table_7" (a integer, b text, primary key(a)); +CREATE TABLE "filter,table_8" (a integer, b text, primary key(a)); +CREATE TABLE "filter""table_9" (a integer, b text, primary key(a)); +CREATE TABLE " filter_table_10" (a integer, b text, primary key(a)); +CREATE TABLE "*" (a integer, b text, primary key(a)); +CREATE TABLE "*".filter_table_0 (a integer, b text, primary key(a)); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO filter_table_1 (a, b) VALUES(1, 'public.filter_table_1'); +INSERT INTO filter_schema_1.filter_table_1 (a, b) VALUES(1, 'filter_schema_1.filter_table_1'); +INSERT INTO filter_schema_1.filter_table_2 (a, b) VALUES(1, 'filter_schema_1.filter_table_2'); +INSERT INTO filter_schema_2.filter_table_1 (a, b) VALUES(1, 'filter_schema_2.filter_table_1'); +INSERT INTO filter_schema_2.filter_table_2 (a, b) VALUES(1, 'filter_schema_2.filter_table_2'); +INSERT INTO filter_schema_2.filter_table_3 (a, b) VALUES(1, 'filter_schema_2.filter_table_3'); +INSERT INTO filter_table_2 (a, b) VALUES(1, 'public.filter_table_2'); +INSERT INTO filter_table_3 (a, b) VALUES(1, 'public.filter_table_3'); +INSERT INTO filter_table_4 (a, b) VALUES(1, 'public.filter_table_4'); +INSERT INTO "Filter_table_5" (a, b) VALUES(1, 'public.Filter_table_5'); +INSERT INTO "filter table_6" (a, b) VALUES(1, 'public.filter table_6'); +INSERT INTO "filter.table_7" (a, b) VALUES(1, 'public.filter.table_7'); +INSERT INTO "filter,table_8" (a, b) VALUES(1, 'public.filter,table_8'); +INSERT INTO "filter""table_9" (a, b) VALUES(1, 'public.filter"table_9'); +INSERT INTO " filter_table_10" (a, b) VALUES(1, 'public. filter_table_10'); +INSERT INTO "*" (a, b) VALUES(1, 'public.*'); +INSERT INTO "*".filter_table_0 (a, b) VALUES(1, '*.filter_table_0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); + data +------------------------------------------------------------------------------- + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "filter_schema_1", + + "table": "filter_table_2", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "filter_schema_1.filter_table_2"]+ + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "filter_table_2", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "public.filter_table_2"] + + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "filter_table_4", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "public.filter_table_4"] + + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } +(17 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/filtertable.sql b/sql/filtertable.sql new file mode 100644 index 000000000000..9ed9d8dac093 --- /dev/null +++ b/sql/filtertable.sql @@ -0,0 +1,64 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS filter_table_1; +DROP TABLE IF EXISTS filter_table_2; +DROP TABLE IF EXISTS filter_table_3; +DROP TABLE IF EXISTS filter_table_4; +DROP TABLE IF EXISTS "Filter_table_5"; +DROP TABLE IF EXISTS "filter table_6"; +DROP TABLE IF EXISTS "filter.table_7"; +DROP TABLE IF EXISTS "filter,table_8"; +DROP TABLE IF EXISTS "filter""table_9"; +DROP TABLE IF EXISTS " filter_table_10"; +DROP TABLE IF EXISTS "*"; +DROP SCHEMA IF EXISTS filter_schema_1 CASCADE; +DROP SCHEMA IF EXISTS filter_schema_2 CASCADE; +DROP SCHEMA IF EXISTS "*" CASCADE; + +CREATE SCHEMA filter_schema_1; +CREATE SCHEMA filter_schema_2; +CREATE SCHEMA "*"; + +CREATE TABLE filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_1.filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_1.filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_1 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_schema_2.filter_table_3 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_2 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_3 (a integer, b text, primary key(a)); +CREATE TABLE filter_table_4 (a integer, b text, primary key(a)); +CREATE TABLE "Filter_table_5" (a integer, b text, primary key(a)); +CREATE TABLE "filter table_6" (a integer, b text, primary key(a)); +CREATE TABLE "filter.table_7" (a integer, b text, primary key(a)); +CREATE TABLE "filter,table_8" (a integer, b text, primary key(a)); +CREATE TABLE "filter""table_9" (a integer, b text, primary key(a)); +CREATE TABLE " filter_table_10" (a integer, b text, primary key(a)); +CREATE TABLE "*" (a integer, b text, primary key(a)); +CREATE TABLE "*".filter_table_0 (a integer, b text, primary key(a)); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO filter_table_1 (a, b) VALUES(1, 'public.filter_table_1'); +INSERT INTO filter_schema_1.filter_table_1 (a, b) VALUES(1, 'filter_schema_1.filter_table_1'); +INSERT INTO filter_schema_1.filter_table_2 (a, b) VALUES(1, 'filter_schema_1.filter_table_2'); +INSERT INTO filter_schema_2.filter_table_1 (a, b) VALUES(1, 'filter_schema_2.filter_table_1'); +INSERT INTO filter_schema_2.filter_table_2 (a, b) VALUES(1, 'filter_schema_2.filter_table_2'); +INSERT INTO filter_schema_2.filter_table_3 (a, b) VALUES(1, 'filter_schema_2.filter_table_3'); +INSERT INTO filter_table_2 (a, b) VALUES(1, 'public.filter_table_2'); +INSERT INTO filter_table_3 (a, b) VALUES(1, 'public.filter_table_3'); +INSERT INTO filter_table_4 (a, b) VALUES(1, 'public.filter_table_4'); +INSERT INTO "Filter_table_5" (a, b) VALUES(1, 'public.Filter_table_5'); +INSERT INTO "filter table_6" (a, b) VALUES(1, 'public.filter table_6'); +INSERT INTO "filter.table_7" (a, b) VALUES(1, 'public.filter.table_7'); +INSERT INTO "filter,table_8" (a, b) VALUES(1, 'public.filter,table_8'); +INSERT INTO "filter""table_9" (a, b) VALUES(1, 'public.filter"table_9'); +INSERT INTO " filter_table_10" (a, b) VALUES(1, 'public. filter_table_10'); +INSERT INTO "*" (a, b) VALUES(1, 'public.*'); +INSERT INTO "*".filter_table_0 (a, b) VALUES(1, '*.filter_table_0'); + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index a9cdd73678ca..09b95db7b299 100644 --- a/wal2json.c +++ b/wal2json.c @@ -42,6 +42,8 @@ typedef struct bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ + List *filter_tables; /* filter out tables */ + /* * LSN pointing to the end of commit record + 1 (txn->end_lsn) * It is useful for tools that wants a position to restart from. @@ -52,6 +54,14 @@ typedef struct /* FIXME replace with txn->nentries */ } JsonDecodingData; +typedef struct FilterTable +{ + char *schemaname; + char *tablename; + bool allschemas; /* true means any schema */ + bool alltables; /* true means any table */ +} FilterTable; + /* These must be available to pg_dlsym() */ static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is_init); static void pg_decode_shutdown(LogicalDecodingContext *ctx); @@ -69,6 +79,9 @@ static void pg_decode_message(LogicalDecodingContext *ctx, Size content_size, const char *content); #endif +static bool parse_table_identifier(List *qualified_tables, char separator, List **filter_tables); +static bool string_to_FilterTable(char *rawstring, char separator, List **filter_tables); + void _PG_init(void) { @@ -118,6 +131,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->write_in_chunks = false; data->include_lsn = false; data->include_not_null = false; + data->filter_tables = NIL; data->nr_changes = 0; @@ -262,6 +276,27 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "filter-tables") == 0) + { + char *rawstr; + + if (elem->arg == NULL) + { + elog(LOG, "filter-tables argument is null"); + data->filter_tables = NIL; + } + + rawstr = pstrdup(strVal(elem->arg)); + if (!string_to_FilterTable(rawstr, ',', &data->filter_tables)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + pfree(rawstr); + } else { ereport(ERROR, @@ -861,6 +896,33 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } + /* Filter tables, if available */ + if (list_length(data->filter_tables) > 0) + { + ListCell *lc; + char *schemaname; + char *tablename; + + schemaname = get_namespace_name(class_form->relnamespace); + tablename = NameStr(class_form->relname); + + foreach(lc, data->filter_tables) + { + FilterTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was filtered out", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + return; + } + } + } + } + /* Change counter */ data->nr_changes++; @@ -1113,3 +1175,145 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, OutputPluginWrite(ctx, true); } #endif + +static bool +parse_table_identifier(List *qualified_tables, char separator, List **filter_tables) +{ + ListCell *lc; + + foreach(lc, qualified_tables) + { + char *str = lfirst(lc); + char *startp; + char *nextp; + int len; + FilterTable *t = palloc0(sizeof(FilterTable)); + + /* + * Detect a special character that means all schemas. There could be a + * schema named "*" thus this test should be before we remove the + * escape character. + */ + if (str[0] == '*' || str[1] == '.') + t->allschemas = true; + else + t->allschemas = false; + + startp = nextp = str; + while (*nextp && *nextp != separator) + { + /* remove escape character */ + if (*nextp == '\\') + memmove(nextp, nextp + 1, strlen(nextp)); + nextp++; + } + len = nextp - startp; + + /* if separator was not found, schema was not informed */ + if (*nextp == '\0') + { + pfree(t); + return false; + } + else + { + /* schema name */ + t->schemaname = (char *) palloc0((len + 1) * sizeof(char)); + strncpy(t->schemaname, startp, len); + + nextp++; /* jump separator */ + startp = nextp; /* start new identifier (table name) */ + + /* + * Detect a special character that means all tables. There could be + * a table named "*" thus this test should be before that we remove + * the escape character. + */ + if (startp[0] == '*' && startp[1] == '\0') + t->alltables = true; + else + t->alltables = false; + + while (*nextp) + { + /* remove escape character */ + if (*nextp == '\\') + memmove(nextp, nextp + 1, strlen(nextp)); + nextp++; + } + len = nextp - startp; + + /* table name */ + t->tablename = (char *) palloc0((len + 1) * sizeof(char)); + strncpy(t->tablename, startp, len); + } + + *filter_tables = lappend(*filter_tables, t); + } + + return true; +} + +static bool +string_to_FilterTable(char *rawstring, char separator, List **filter_tables) +{ + char *nextp; + bool done = false; + List *qualified_tables = NIL; + + nextp = rawstring; + + while (isspace(*nextp)) + nextp++; /* skip leading whitespace */ + + if (*nextp == '\0') + return true; /* allow empty string */ + + /* At the top of the loop, we are at start of a new identifier. */ + do + { + char *curname; + char *endp; + + curname = nextp; + while (*nextp && *nextp != separator && !isspace(*nextp)) + { + if (*nextp == '\\') + nextp++; /* ignore next character because of escape */ + nextp++; + } + endp = nextp; + if (curname == nextp) + return false; /* empty unquoted name not allowed */ + + while (isspace(*nextp)) + nextp++; /* skip trailing whitespace */ + + if (*nextp == separator) + { + nextp++; + while (isspace(*nextp)) + nextp++; /* skip leading whitespace for next */ + /* we expect another name, so done remains false */ + } + else if (*nextp == '\0') + done = true; + else + return false; /* invalid syntax */ + + /* Now safe to overwrite separator with a null */ + *endp = '\0'; + + /* + * Finished isolating current name --- add it to list + */ + qualified_tables = lappend(qualified_tables, curname); + + /* Loop back if we didn't reach end of string */ + } while (!done); + + if (!parse_table_identifier(qualified_tables, '.', filter_tables)) + return false; + + return true; +} From d13e74940982370a96f3d62ba9e47a5264eb96af Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 26 Mar 2018 22:08:02 -0300 Subject: [PATCH 043/154] Select tables to retrieve data The new parameter 'add-tables' select only data from those tables. Like parameter 'filter-tables', it is a comma separated value that contains schema.table elements. Both schema and table can be * that denotes all. Escape also works for special characters. By default, all tables in all schemas are selected. --- Makefile | 2 +- expected/selecttable.out | 129 +++++++++++++++++++++++++++++++++++++++ sql/selecttable.sql | 37 +++++++++++ wal2json.c | 106 ++++++++++++++++++++++++++------ 4 files changed, 256 insertions(+), 18 deletions(-) create mode 100644 expected/selecttable.out create mode 100644 sql/selecttable.sql diff --git a/Makefile b/Makefile index 0816c7bc5612..8b1e11185c0b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ - filtertable + filtertable selecttable PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/selecttable.out b/expected/selecttable.out new file mode 100644 index 000000000000..03d47b507305 --- /dev/null +++ b/expected/selecttable.out @@ -0,0 +1,129 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS select_table_1; +NOTICE: table "select_table_1" does not exist, skipping +DROP TABLE IF EXISTS select_table_2; +NOTICE: table "select_table_2" does not exist, skipping +DROP TABLE IF EXISTS select_table_3; +NOTICE: table "select_table_3" does not exist, skipping +DROP SCHEMA IF EXISTS select_schema_1 CASCADE; +NOTICE: schema "select_schema_1" does not exist, skipping +DROP SCHEMA IF EXISTS select_schema_2 CASCADE; +NOTICE: schema "select_schema_2" does not exist, skipping +CREATE SCHEMA select_schema_1; +CREATE SCHEMA select_schema_2; +CREATE TABLE select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_1.select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_1.select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_3 (a integer, b text, primary key(a)); +CREATE TABLE select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_table_3 (a integer, b text, primary key(a)); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO select_table_1 (a, b) VALUES(1, 'public.select_table_1'); +INSERT INTO select_schema_1.select_table_1 (a, b) VALUES(1, 'select_schema_1.select_table_1'); +INSERT INTO select_schema_1.select_table_2 (a, b) VALUES(1, 'select_schema_1.select_table_2'); +INSERT INTO select_schema_2.select_table_1 (a, b) VALUES(1, 'select_schema_2.select_table_1'); +INSERT INTO select_schema_2.select_table_2 (a, b) VALUES(1, 'select_schema_2.select_table_2'); +INSERT INTO select_schema_2.select_table_3 (a, b) VALUES(1, 'select_schema_2.select_table_3'); +INSERT INTO select_table_2 (a, b) VALUES(1, 'public.select_table_2'); +INSERT INTO select_table_3 (a, b) VALUES(1, 'public.select_table_3'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); + data +------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "select_table_1", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "public.select_table_1"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "select_schema_1", + + "table": "select_table_1", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "select_schema_1.select_table_1"]+ + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "select_schema_2", + + "table": "select_table_1", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "select_schema_2.select_table_1"]+ + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "select_schema_2", + + "table": "select_table_2", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "select_schema_2.select_table_2"]+ + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "select_schema_2", + + "table": "select_table_3", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "select_schema_2.select_table_3"]+ + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "select_table_3", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"], + + "columnvalues": [1, "public.select_table_3"] + + } + + ] + + } +(8 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + + diff --git a/sql/selecttable.sql b/sql/selecttable.sql new file mode 100644 index 000000000000..aac1aad68225 --- /dev/null +++ b/sql/selecttable.sql @@ -0,0 +1,37 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS select_table_1; +DROP TABLE IF EXISTS select_table_2; +DROP TABLE IF EXISTS select_table_3; +DROP SCHEMA IF EXISTS select_schema_1 CASCADE; +DROP SCHEMA IF EXISTS select_schema_2 CASCADE; + +CREATE SCHEMA select_schema_1; +CREATE SCHEMA select_schema_2; + +CREATE TABLE select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_1.select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_1.select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_1 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_schema_2.select_table_3 (a integer, b text, primary key(a)); +CREATE TABLE select_table_2 (a integer, b text, primary key(a)); +CREATE TABLE select_table_3 (a integer, b text, primary key(a)); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO select_table_1 (a, b) VALUES(1, 'public.select_table_1'); +INSERT INTO select_schema_1.select_table_1 (a, b) VALUES(1, 'select_schema_1.select_table_1'); +INSERT INTO select_schema_1.select_table_2 (a, b) VALUES(1, 'select_schema_1.select_table_2'); +INSERT INTO select_schema_2.select_table_1 (a, b) VALUES(1, 'select_schema_2.select_table_1'); +INSERT INTO select_schema_2.select_table_2 (a, b) VALUES(1, 'select_schema_2.select_table_2'); +INSERT INTO select_schema_2.select_table_3 (a, b) VALUES(1, 'select_schema_2.select_table_3'); +INSERT INTO select_table_2 (a, b) VALUES(1, 'public.select_table_2'); +INSERT INTO select_table_3 (a, b) VALUES(1, 'public.select_table_3'); + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + diff --git a/wal2json.c b/wal2json.c index 09b95db7b299..56fa7990a0b9 100644 --- a/wal2json.c +++ b/wal2json.c @@ -43,6 +43,7 @@ typedef struct bool write_in_chunks; /* write in chunks? */ List *filter_tables; /* filter out tables */ + List *add_tables; /* add only these tables */ /* * LSN pointing to the end of commit record + 1 (txn->end_lsn) @@ -54,13 +55,13 @@ typedef struct /* FIXME replace with txn->nentries */ } JsonDecodingData; -typedef struct FilterTable +typedef struct SelectTable { char *schemaname; char *tablename; bool allschemas; /* true means any schema */ bool alltables; /* true means any table */ -} FilterTable; +} SelectTable; /* These must be available to pg_dlsym() */ static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is_init); @@ -79,8 +80,8 @@ static void pg_decode_message(LogicalDecodingContext *ctx, Size content_size, const char *content); #endif -static bool parse_table_identifier(List *qualified_tables, char separator, List **filter_tables); -static bool string_to_FilterTable(char *rawstring, char separator, List **filter_tables); +static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); +static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); void _PG_init(void) @@ -109,6 +110,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { ListCell *option; JsonDecodingData *data; + SelectTable *t; data = palloc0(sizeof(JsonDecodingData)); data->context = AllocSetContextCreate(TopMemoryContext, @@ -133,6 +135,12 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_not_null = false; data->filter_tables = NIL; + /* add all tables in all schemas by default */ + t = palloc0(sizeof(SelectTable)); + t->allschemas = true; + t->alltables = true; + data->add_tables = lappend(data->add_tables, t); + data->nr_changes = 0; ctx->output_plugin_private = data; @@ -287,7 +295,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is } rawstr = pstrdup(strVal(elem->arg)); - if (!string_to_FilterTable(rawstr, ',', &data->filter_tables)) + if (!string_to_SelectTable(rawstr, ',', &data->filter_tables)) { pfree(rawstr); ereport(ERROR, @@ -297,6 +305,36 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is } pfree(rawstr); } + else if (strcmp(elem->defname, "add-tables") == 0) + { + char *rawstr; + + /* + * If this parameter is specified, remove 'all tables in all + * schemas' value from list. + */ + list_free_deep(data->add_tables); + data->add_tables = NIL; + + if (elem->arg == NULL) + { + elog(LOG, "add-tables argument is null"); + data->add_tables = NIL; + } + else + { + rawstr = pstrdup(strVal(elem->arg)); + if (!string_to_SelectTable(rawstr, ',', &data->add_tables)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + pfree(rawstr); + } + } else { ereport(ERROR, @@ -819,6 +857,9 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation indexrel; TupleDesc indexdesc; + char *schemaname; + char *tablename; + AssertVariableIsOfType(&pg_decode_change, LogicalDecodeChangeCB); data = ctx->output_plugin_private; @@ -828,6 +869,10 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); + /* schema and table names are used for select tables */ + schemaname = get_namespace_name(class_form->relnamespace); + tablename = NameStr(class_form->relname); + if (data->write_in_chunks) OutputPluginPrepareWrite(ctx, true); @@ -900,15 +945,10 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (list_length(data->filter_tables) > 0) { ListCell *lc; - char *schemaname; - char *tablename; - - schemaname = get_namespace_name(class_form->relnamespace); - tablename = NameStr(class_form->relname); foreach(lc, data->filter_tables) { - FilterTable *t = lfirst(lc); + SelectTable *t = lfirst(lc); if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) { @@ -923,6 +963,34 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } } + /* Add tables */ + if (list_length(data->add_tables) > 0) + { + ListCell *lc; + bool skip = true; + + /* all tables in all schemas are added by default */ + foreach(lc, data->add_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was added", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + skip = false; + } + } + } + + /* table was not found */ + if (skip) + return; + } + /* Change counter */ data->nr_changes++; @@ -1177,7 +1245,7 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, #endif static bool -parse_table_identifier(List *qualified_tables, char separator, List **filter_tables) +parse_table_identifier(List *qualified_tables, char separator, List **select_tables) { ListCell *lc; @@ -1187,7 +1255,7 @@ parse_table_identifier(List *qualified_tables, char separator, List **filter_tab char *startp; char *nextp; int len; - FilterTable *t = palloc0(sizeof(FilterTable)); + SelectTable *t = palloc0(sizeof(SelectTable)); /* * Detect a special character that means all schemas. There could be a @@ -1248,14 +1316,14 @@ parse_table_identifier(List *qualified_tables, char separator, List **filter_tab strncpy(t->tablename, startp, len); } - *filter_tables = lappend(*filter_tables, t); + *select_tables = lappend(*select_tables, t); } return true; } static bool -string_to_FilterTable(char *rawstring, char separator, List **filter_tables) +string_to_SelectTable(char *rawstring, char separator, List **select_tables) { char *nextp; bool done = false; @@ -1274,6 +1342,7 @@ string_to_FilterTable(char *rawstring, char separator, List **filter_tables) { char *curname; char *endp; + char *qname; curname = nextp; while (*nextp && *nextp != separator && !isspace(*nextp)) @@ -1307,13 +1376,16 @@ string_to_FilterTable(char *rawstring, char separator, List **filter_tables) /* * Finished isolating current name --- add it to list */ - qualified_tables = lappend(qualified_tables, curname); + qname = pstrdup(curname); + qualified_tables = lappend(qualified_tables, qname); /* Loop back if we didn't reach end of string */ } while (!done); - if (!parse_table_identifier(qualified_tables, '.', filter_tables)) + if (!parse_table_identifier(qualified_tables, '.', select_tables)) return false; + list_free_deep(qualified_tables); + return true; } From 947043e22accdf8276536a5878c34e7984b89916 Mon Sep 17 00:00:00 2001 From: Robert Coup Date: Mon, 22 Jan 2018 15:13:20 +0000 Subject: [PATCH 044/154] Preserve unchanged toast values by default. Use `include-unchanged-toast=0` option to suppress. --- expected/bytea.out | 3 +-- expected/toast.out | 44 +++++++++++++++++++++++++------------------- sql/bytea.sql | 2 +- sql/toast.sql | 6 +++++- wal2json.c | 21 ++++++++++++++++++--- 5 files changed, 50 insertions(+), 26 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index e40b91028181..5c032741c22f 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -22,8 +22,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); -WARNING: column "bincol" has an unchanged TOAST +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + diff --git a/expected/toast.out b/expected/toast.out index baa43fbb19dc..648ad89b9545 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -28,11 +28,7 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), -- update of existing column UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; -DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); -WARNING: column "toasted_col2" has an unchanged TOAST -WARNING: column "toasted_col1" has an unchanged TOAST -WARNING: column "toasted_col2" has an unchanged TOAST +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -93,21 +89,31 @@ WARNING: column "toasted_col2" has an unchanged TOAST } + ] + } - { + - "change": [ + - { + - "kind": "delete", + - "schema": "public", + - "table": "xpto", + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + +(4 rows) + +UPDATE xpto SET rand1 = 234.567 WHERE id = 1; +-- include-unchanged-toast=1 is the default +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + + "columntypes": ["int4", "text", "float8", "text", "float8"], + + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 234.567, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 0.394382926635444],+ + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } -(5 rows) +(1 row) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/bytea.sql b/sql/bytea.sql index 157fc38dcc20..e5fe7d2c3ae5 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -18,5 +18,5 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index 1bcede60fc0e..4c2c294402c7 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -27,7 +27,11 @@ UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_s UPDATE xpto SET rand1 = 123.456 WHERE id = 1; -DELETE FROM xpto WHERE id = 1; +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); +UPDATE xpto SET rand1 = 234.567 WHERE id = 1; + +-- include-unchanged-toast=1 is the default SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 69a4f6c0b54f..a9d85c72ad3d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -39,6 +39,7 @@ typedef struct bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ bool include_not_null; /* include not-null constraints */ + bool include_unchanged_toast; /* include unchanged TOAST field values in output */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -134,6 +135,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->write_in_chunks = false; data->include_lsn = false; data->include_not_null = false; + data->include_unchanged_toast = true; data->filter_tables = NIL; /* add all tables in all schemas by default */ @@ -336,6 +338,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is pfree(rawstr); } } + else if (strcmp(elem->defname, "include-unchanged-toast") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-unchanged-toast is null"); + data->include_unchanged_toast = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_unchanged_toast)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else { ereport(ERROR, @@ -598,10 +613,10 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (isnull && replident) continue; - /* XXX Unchanged TOAST Datum does not need to be output */ - if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) + if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval) && !(data->include_unchanged_toast)) { - elog(WARNING, "column \"%s\" has an unchanged TOAST", NameStr(attr->attname)); + /* With include-unchanged-toast=0, unchanged TOAST Datum do not need to be output */ + elog(DEBUG1, "column \"%s\" has an unchanged TOAST - excluding", NameStr(attr->attname)); continue; } From d86a13bd788d748f50bf801810c88a51ea96a16c Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 27 Mar 2018 09:54:45 -0300 Subject: [PATCH 045/154] Style fixes for last commit --- wal2json.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/wal2json.c b/wal2json.c index a9d85c72ad3d..92bbc0f7e141 100644 --- a/wal2json.c +++ b/wal2json.c @@ -39,7 +39,7 @@ typedef struct bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ bool include_not_null; /* include not-null constraints */ - bool include_unchanged_toast; /* include unchanged TOAST field values in output */ + bool include_unchanged_toast; /* include unchanged TOAST field values in output */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -287,6 +287,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-unchanged-toast") == 0) + { + if (elem->arg == NULL) + { + elog(LOG, "include-unchanged-toast is null"); + data->include_unchanged_toast = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_unchanged_toast)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "filter-tables") == 0) { char *rawstr; @@ -338,19 +351,6 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is pfree(rawstr); } } - else if (strcmp(elem->defname, "include-unchanged-toast") == 0) - { - if (elem->arg == NULL) - { - elog(LOG, "include-unchanged-toast is null"); - data->include_unchanged_toast = true; - } - else if (!parse_bool(strVal(elem->arg), &data->include_unchanged_toast)) - ereport(ERROR, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); - } else { ereport(ERROR, @@ -613,10 +613,10 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (isnull && replident) continue; - if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval) && !(data->include_unchanged_toast)) + if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval) && !data->include_unchanged_toast) { - /* With include-unchanged-toast=0, unchanged TOAST Datum do not need to be output */ - elog(DEBUG1, "column \"%s\" has an unchanged TOAST - excluding", NameStr(attr->attname)); + /* TOAST value is not returned if include-unchanged-toast is specified */ + elog(DEBUG2, "column \"%s\" has an unchanged TOAST - excluding", NameStr(attr->attname)); continue; } From 5bb7be5e52d5071e18d1acc051164ae09011a4f3 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 27 Mar 2018 10:06:54 -0300 Subject: [PATCH 046/154] Copyright update --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 68d0504d6d4f..9f3b300a308d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2017, Euler Taveira de Oliveira +Copyright (c) 2013-2018, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index 79af7af9bef3..cd07a4dd0d71 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ stop License ======= -> Copyright (c) 2013-2017, Euler Taveira de Oliveira +> Copyright (c) 2013-2018, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index 92bbc0f7e141..fbfab74e3a26 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2017, PostgreSQL Global Development Group + * Copyright (c) 2013-2018, PostgreSQL Global Development Group * * IDENTIFICATION * contrib/wal2json/wal2json.c From 1b191ff9238fbe3250291c7de540098444d01570 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 27 Mar 2018 11:35:37 -0300 Subject: [PATCH 047/154] Document parameters --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index cd07a4dd0d71..f4bc1e1b1642 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,9 @@ Sorry, never tried it. ;( Configuration ============= +postgresql.conf +--------------- + You need to set up at least two parameters at postgresql.conf: ``` @@ -54,6 +57,23 @@ max_replication_slots = 1 After changing these parameters, a restart is needed. +Parameters +---------- + +* `include-xids`: add _xid_ to each changeset. Default is _false_. +* `include-timestamp`: add _timestamp_ to each changeset. Default is _false_. +* `include-schemas`: add _schema_ to each change. Default is _true_. +* `include-types`: add _type_ to each change. Default is _true_. +* `include-typmod`: add modifier to types that have it (eg. varchar(20) instead of varchar). Default is _true_. +* `include-type-oids`: add type oids. Default is _false_. +* `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. +* `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. +* `write-in-chunks`: write after every change instead of every changeset. Default is _false_. +* `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. +* `include-unchanged-toast`: add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. +* `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. +* `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. + Examples ======== From 1ce1010423f543652e9b46a222b3fad60e3a422d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 27 Mar 2018 12:14:43 -0300 Subject: [PATCH 048/154] Update examples The examples don't reflect the defaults options. Also, rename tables in SQL functions example (avoid table conflict with the other test). --- README.md | 89 +++++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index f4bc1e1b1642..e09efed9b183 100644 --- a/README.md +++ b/README.md @@ -77,18 +77,17 @@ Parameters Examples ======== -There are two ways to obtain the changes (JSON objects) from **wal2json** plugin: (i) calling functions via SQL or (ii) pg_recvlogical. +There are two ways to obtain the changes (JSON objects) from **wal2json** plugin: calling functions via SQL or pg_recvlogical. pg_recvlogical -------------- Besides the configuration above, it is necessary to configure a replication connection to use pg_recvlogical. -First, add an entry at pg_hba.conf: +First, add a replication connection rule at pg_hba.conf: ``` local replication myuser trust -host replication myuser 10.1.2.3/32 trust ``` Also, set max_wal_senders at postgresql.conf: @@ -103,7 +102,7 @@ You are ready to try wal2json. In one terminal: ``` $ pg_recvlogical -d postgres --slot test_slot --create-slot -P wal2json -$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -o write-in-chunks=0 -f - +$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -f - ``` In another terminal: @@ -124,7 +123,7 @@ INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; -$ psql -At -f /tmp/example1.sql +$ psql -At -f /tmp/example1.sql postgres CREATE TABLE CREATE TABLE BEGIN @@ -149,7 +148,6 @@ The output in the first terminal is: ] } WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/126E5F70 { "change": [ { @@ -157,24 +155,24 @@ CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, a "schema": "public", "table": "table_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [1, "Backup and Restore", "2015-08-27 16:46:35.818038"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [1, "Backup and Restore", "2018-03-27 11:58:28.988414"] } ,{ "kind": "insert", "schema": "public", "table": "table_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [2, "Tuning", "2015-08-27 16:46:35.818038"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [2, "Tuning", "2018-03-27 11:58:28.988414"] } ,{ "kind": "insert", "schema": "public", "table": "table_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [3, "Replication", "2015-08-27 16:46:35.818038"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [3, "Replication", "2018-03-27 11:58:28.988414"] } ,{ "kind": "delete", @@ -182,8 +180,8 @@ CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, a "table": "table_with_pk", "oldkeys": { "keynames": ["a", "c"], - "keytypes": ["int4", "timestamp"], - "keyvalues": [1, "2015-08-27 16:46:35.818038"] + "keytypes": ["integer", "timestamp without time zone"], + "keyvalues": [1, "2018-03-27 11:58:28.988414"] } } ,{ @@ -192,8 +190,8 @@ CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, a "table": "table_with_pk", "oldkeys": { "keynames": ["a", "c"], - "keytypes": ["int4", "timestamp"], - "keyvalues": [2, "2015-08-27 16:46:35.818038"] + "keytypes": ["integer", "timestamp without time zone"], + "keyvalues": [2, "2018-03-27 11:58:28.988414"] } } ,{ @@ -201,7 +199,7 @@ CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, a "schema": "public", "table": "table_without_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "numeric", "text"], + "columntypes": ["integer", "numeric(5,2)", "text"], "columnvalues": [1, 2.34, "Tapir"] } ] @@ -220,30 +218,30 @@ SQL functions ``` $ cat /tmp/example2.sql -CREATE TABLE table_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); -CREATE TABLE table_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); +CREATE TABLE table2_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table2_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); SELECT 'init' FROM pg_create_logical_replication_slot('test_slot', 'wal2json'); BEGIN; -INSERT INTO table_with_pk (b, c) VALUES('Backup and Restore', now()); -INSERT INTO table_with_pk (b, c) VALUES('Tuning', now()); -INSERT INTO table_with_pk (b, c) VALUES('Replication', now()); -DELETE FROM table_with_pk WHERE a < 3; +INSERT INTO table2_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table2_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table2_with_pk (b, c) VALUES('Replication', now()); +DELETE FROM table2_with_pk WHERE a < 3; -INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); +INSERT INTO table2_without_pk (b, c) VALUES(2.34, 'Tapir'); -- it is not added to stream because there isn't a pk or a replica identity -UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +UPDATE table2_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; -SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'pretty-print', '1', 'write-in-chunks', '0'); +SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'pretty-print', '1'); SELECT 'stop' FROM pg_drop_replication_slot('test_slot'); ``` The script above produces the output below: ``` -$ psql -At -f /tmp/example2.sql +$ psql -At -f /tmp/example2.sql postgres CREATE TABLE CREATE TABLE init @@ -255,60 +253,59 @@ DELETE 2 INSERT 0 1 UPDATE 1 COMMIT -psql:/tmp/example2.sql:17: WARNING: table "table_without_pk" without primary key or replica identity is nothing -CONTEXTO: slot "test_slot", output plugin "wal2json", in the change callback, associated LSN 0/12713E40 +psql:/tmp/example2.sql:17: WARNING: table "table2_without_pk" without primary key or replica identity is nothing { "change": [ { "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table2_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [1, "Backup and Restore", "2015-08-27 16:49:37.218511"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [1, "Backup and Restore", "2018-03-27 12:05:29.914496"] } ,{ "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table2_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [2, "Tuning", "2015-08-27 16:49:37.218511"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [2, "Tuning", "2018-03-27 12:05:29.914496"] } ,{ "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table2_with_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "varchar", "timestamp"], - "columnvalues": [3, "Replication", "2015-08-27 16:49:37.218511"] + "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], + "columnvalues": [3, "Replication", "2018-03-27 12:05:29.914496"] } ,{ "kind": "delete", "schema": "public", - "table": "table_with_pk", + "table": "table2_with_pk", "oldkeys": { "keynames": ["a", "c"], - "keytypes": ["int4", "timestamp"], - "keyvalues": [1, "2015-08-27 16:49:37.218511"] + "keytypes": ["integer", "timestamp without time zone"], + "keyvalues": [1, "2018-03-27 12:05:29.914496"] } } ,{ "kind": "delete", "schema": "public", - "table": "table_with_pk", + "table": "table2_with_pk", "oldkeys": { "keynames": ["a", "c"], - "keytypes": ["int4", "timestamp"], - "keyvalues": [2, "2015-08-27 16:49:37.218511"] + "keytypes": ["integer", "timestamp without time zone"], + "keyvalues": [2, "2018-03-27 12:05:29.914496"] } } ,{ "kind": "insert", "schema": "public", - "table": "table_without_pk", + "table": "table2_without_pk", "columnnames": ["a", "b", "c"], - "columntypes": ["int4", "numeric", "text"], + "columntypes": ["integer", "numeric(5,2)", "text"], "columnvalues": [1, 2.34, "Tapir"] } ] From edaced359a835d12edd246ed0ba51b6dba82bf34 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 29 Mar 2018 20:09:53 -0300 Subject: [PATCH 049/154] Build wal2json out of the tree on Windows Build out of the tree is a common task in Unix-like systems (PostgreSQL has PGXS but it doesn't support Windows). This commit adds a project file to build out of the tree on Windows. I also add minimal instructions to build on Windows. I tested wal2json on MS Visual Studio 2017 (version 15.6.4) on a x64 platform. --- README.md | 2 +- wal2json.c | 2 +- wal2json.vcxproj | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 wal2json.vcxproj diff --git a/README.md b/README.md index e09efed9b183..0d39728b3908 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ USE_PGXS=1 make install Windows ------- -Sorry, never tried it. ;( +There are several ways to build wal2json on Windows. If you are build PostgreSQL too, you can put wal2json directory inside contrib, change the contrib Makefile (variable SUBDIRS) and build it following the [Installation from Source Code on Windows](http://www.postgresql.org/docs/current/static/install-windows.html) instructions. However, if you already have PostgreSQL installed, it is also possible to compile **wal2json** out of the tree. Edit wal2json.vcxproj file and change `c:\postgres\pg103` to the PostgreSQL prefix directory. The next step is to open this project file in MS Visual Studio and compile it. Final step is to copy `wal2json.dll` to the `pg_config --pkglibdir` directory. Configuration ============= diff --git a/wal2json.c b/wal2json.c index fbfab74e3a26..9cdf4fe4e9cb 100644 --- a/wal2json.c +++ b/wal2json.c @@ -27,7 +27,7 @@ PG_MODULE_MAGIC; extern void _PG_init(void); -extern void _PG_output_plugin_init(OutputPluginCallbacks *cb); +extern void PGDLLEXPORT _PG_output_plugin_init(OutputPluginCallbacks *cb); typedef struct { diff --git a/wal2json.vcxproj b/wal2json.vcxproj new file mode 100644 index 000000000000..1c16609605e9 --- /dev/null +++ b/wal2json.vcxproj @@ -0,0 +1,96 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {185AF5B6-C04A-4710-8330-18A4416BD225} + Win32Proj + 8.1 + + + + DynamicLibrary + true + v141 + + + DynamicLibrary + false + v141 + + + + + + + + + + + + + + + false + + + false + + + + C:\postgres\pg103\include\server\port\win32_msvc;C:\postgres\pg103\include\server\port\win32;C:\postgres\pg103\include\server;C:\postgres\pg103\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG=1%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + 4018;4244;4273;4102;4090;4267;%(DisableSpecificWarnings) + /MP %(AdditionalOptions) + Default + + + .\x64\Debug\wal2json.dll + C:\postgres\pg103\lib;%(AdditionalLibraryDirectories) + postgres.lib;libpgcommon.lib;libpgport.lib;%(AdditionalDependencies) + MachineX64 + /ignore:4197 %(AdditionalOptions) + + + false + + + + + C:\postgres\pg103\include\server\port\win32_msvc;C:\postgres\pg103\include\server\port\win32;C:\postgres\pg103\include\server;C:\postgres\pg103\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG=1%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + 4018;4244;4273;4102;4090;4267;%(DisableSpecificWarnings) + /MP %(AdditionalOptions) + Default + + + .\x64\Release\wal2json.dll + C:\postgres\pg103\lib;%(AdditionalLibraryDirectories) + postgres.lib;libpgcommon.lib;libpgport.lib;%(AdditionalDependencies) + MachineX64 + /ignore:4197 %(AdditionalOptions) + + + false + + + + + + + + + \ No newline at end of file From d2b7fef021c46e0d429f2c1768de361069e58696 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 29 Mar 2018 20:18:59 -0300 Subject: [PATCH 050/154] Improve style --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d39728b3908..a045e3bb4cce 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ USE_PGXS=1 make install Windows ------- -There are several ways to build wal2json on Windows. If you are build PostgreSQL too, you can put wal2json directory inside contrib, change the contrib Makefile (variable SUBDIRS) and build it following the [Installation from Source Code on Windows](http://www.postgresql.org/docs/current/static/install-windows.html) instructions. However, if you already have PostgreSQL installed, it is also possible to compile **wal2json** out of the tree. Edit wal2json.vcxproj file and change `c:\postgres\pg103` to the PostgreSQL prefix directory. The next step is to open this project file in MS Visual Studio and compile it. Final step is to copy `wal2json.dll` to the `pg_config --pkglibdir` directory. +There are several ways to build **wal2json** on Windows. If you are build PostgreSQL too, you can put **wal2json** directory inside contrib, change the contrib Makefile (variable SUBDIRS) and build it following the [Installation from Source Code on Windows](http://www.postgresql.org/docs/current/static/install-windows.html) instructions. However, if you already have PostgreSQL installed, it is also possible to compile **wal2json** out of the tree. Edit `wal2json.vcxproj` file and change `c:\postgres\pg103` to the PostgreSQL prefix directory. The next step is to open this project file in MS Visual Studio and compile it. Final step is to copy `wal2json.dll` to the `pg_config --pkglibdir` directory. Configuration ============= @@ -98,7 +98,7 @@ max_wal_senders = 1 A restart is necessary if you changed max_wal_senders. -You are ready to try wal2json. In one terminal: +You are ready to try **wal2json**. In one terminal: ``` $ pg_recvlogical -d postgres --slot test_slot --create-slot -P wal2json From a412438824d864374d00cd7ffa65708a1d14f5df Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 10 Apr 2018 16:18:37 -0300 Subject: [PATCH 051/154] Fix oversight in copyright message LICENSE is correct but C file has wrong copyright message. --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 9cdf4fe4e9cb..e3a082ecf131 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2018, PostgreSQL Global Development Group + * Copyright (c) 2013-2018, Euler Taveira de Oliveira * * IDENTIFICATION * contrib/wal2json/wal2json.c From 7976bf92e07f7be183f8cb47f61610a2f77aa3f1 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 11 Apr 2018 00:25:45 -0300 Subject: [PATCH 052/154] Tweak message test Per PR #59, replace bytea value with valid data. --- expected/message.out | 12 ++++++------ sql/message.sql | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/expected/message.out b/expected/message.out index bf664c9df3cd..dceacea512a8 100644 --- a/expected/message.out +++ b/expected/message.out @@ -19,19 +19,19 @@ SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" msg2 (1 row) -SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x31320033003435'::bytea); +SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x546170697275732074657272657374726973'::bytea); ?column? ---------- msg3 (1 row) -SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\xC0FFEE00C0FFEE'::bytea); +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\x5072696f646f6e746573206d6178696d7573'::bytea); ?column? ---------- msg4 (1 row) -SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x01020300101112'::bytea); +SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x436172796f6361722062726173696c69656e7365'::bytea); ?column? ---------- msg5 @@ -100,7 +100,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "kind": "message", + "transactional": false, + "prefix": "wal2json", + - "content": "12" + + "content": "Tapirus terrestris" + } + ] + } @@ -110,7 +110,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "kind": "message", + "transactional": false, + "prefix": "wal2json", + - "content": "" + + "content": "Priodontes maximus" + } + ] + } @@ -120,7 +120,7 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "kind": "message", + "transactional": false, + "prefix": "wal2json", + - "content": "\u0001\u0002\u0003" + + "content": "Caryocar brasiliense" + } + ] + } diff --git a/sql/message.sql b/sql/message.sql index 8df73db0e3f6..ebaa5fef2a48 100644 --- a/sql/message.sql +++ b/sql/message.sql @@ -8,9 +8,9 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT 'msg1' FROM pg_logical_emit_message(true, 'wal2json', 'this is a\ message'); SELECT 'msg2' FROM pg_logical_emit_message(false, 'wal2json', 'this is "another" message'); -SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x31320033003435'::bytea); -SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\xC0FFEE00C0FFEE'::bytea); -SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x01020300101112'::bytea); +SELECT 'msg3' FROM pg_logical_emit_message(false, 'wal2json', E'\\x546170697275732074657272657374726973'::bytea); +SELECT 'msg4' FROM pg_logical_emit_message(false, 'wal2json', E'\\x5072696f646f6e746573206d6178696d7573'::bytea); +SELECT 'msg5' FROM pg_logical_emit_message(false, 'wal2json', E'\\x436172796f6361722062726173696c69656e7365'::bytea); BEGIN; SELECT 'msg6' FROM pg_logical_emit_message(true, 'wal2json', 'this message will not be printed'); From 01c5c1ec37b2c27baf00649c028b03936427596a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 30 Apr 2018 00:32:27 -0300 Subject: [PATCH 053/154] Sanity checks after selective table options The sanity checks should be run after filter-tables and add-tables options to avoid a bunch of unsolicited warnings (per issue #64). --- wal2json.c | 100 ++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/wal2json.c b/wal2json.c index e3a082ecf131..28267c3224e3 100644 --- a/wal2json.c +++ b/wal2json.c @@ -852,6 +852,56 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Make sure rd_replidindex is set */ RelationGetIndexList(relation); + /* Filter tables, if available */ + if (list_length(data->filter_tables) > 0) + { + ListCell *lc; + + foreach(lc, data->filter_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was filtered out", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + return; + } + } + } + } + + /* Add tables */ + if (list_length(data->add_tables) > 0) + { + ListCell *lc; + bool skip = true; + + /* all tables in all schemas are added by default */ + foreach(lc, data->add_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was added", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + skip = false; + } + } + } + + /* table was not found */ + if (skip) + return; + } + /* Sanity checks */ switch (change->action) { @@ -914,56 +964,6 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } - /* Filter tables, if available */ - if (list_length(data->filter_tables) > 0) - { - ListCell *lc; - - foreach(lc, data->filter_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was filtered out", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - return; - } - } - } - } - - /* Add tables */ - if (list_length(data->add_tables) > 0) - { - ListCell *lc; - bool skip = true; - - /* all tables in all schemas are added by default */ - foreach(lc, data->add_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was added", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = false; - } - } - } - - /* table was not found */ - if (skip) - return; - } - /* Change counter */ data->nr_changes++; From d4c0e814696695bbf853c48b38b7479e0f83f6c7 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 23 May 2018 02:12:07 +0000 Subject: [PATCH 054/154] Refactor wal2json output Almost all writes were handled in two different ways: with or without pretty print. It means more lines of code and an error-prone code. The new code avoids all of the pretty-print tests and also uses only one setence per output. It reduces the code by more than 150 lines. I also fix some comments (use only C89 comments) and improve style. --- expected/cmdline.out | 8 +- wal2json.c | 371 +++++++++++++------------------------------ 2 files changed, 111 insertions(+), 268 deletions(-) diff --git a/expected/cmdline.out b/expected/cmdline.out index 35d9295629d4..2cdb0d9a9b00 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -21,11 +21,11 @@ UPDATE table_optional SET b = 123 WHERE a = 1; DELETE FROM table_optional WHERE a = 1; DROP TABLE table_optional; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'include-not-null', '1'); - data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"change":[]} - {"change":[{"kind":"insert","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals": [false,true,false],"columnvalues":[1,null,true]}]} - {"change":[{"kind":"update","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals": [false,true,false],"columnvalues":[1,123,true],"oldkeys":{"keynames":["a"],"keytypes":["smallint"],"keyvalues":[1]}}]} + {"change":[{"kind":"insert","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals":[false,true,false],"columnvalues":[1,null,true]}]} + {"change":[{"kind":"update","schema":"public","table":"table_optional","columnnames":["a","b","c"],"columntypes":["smallint","integer","boolean"],"columnoptionals":[false,true,false],"columnvalues":[1,123,true],"oldkeys":{"keynames":["a"],"keytypes":["smallint"],"keyvalues":[1]}}]} {"change":[{"kind":"delete","schema":"public","table":"table_optional","oldkeys":{"keynames":["a"],"keytypes":["smallint"],"keyvalues":[1]}}]} {"change":[]} (5 rows) diff --git a/wal2json.c b/wal2json.c index 28267c3224e3..4761ec02982b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -55,6 +55,11 @@ typedef struct uint64 nr_changes; /* # of passes in pg_decode_change() */ /* FIXME replace with txn->nentries */ + + /* pretty print */ + char ht[2]; /* horizontal tab, if pretty print */ + char nl[2]; /* new line, if pretty print */ + char sp[2]; /* space, if pretty print */ } JsonDecodingData; typedef struct SelectTable @@ -138,6 +143,11 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_unchanged_toast = true; data->filter_tables = NIL; + /* pretty print */ + strcpy(data->ht, ""); + strcpy(data->nl, ""); + strcpy(data->sp, ""); + /* add all tables in all schemas by default */ t = palloc0(sizeof(SelectTable)); t->allschemas = true; @@ -260,6 +270,13 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); + + if (data->pretty_print) + { + strncpy(data->ht, "\t", 1); + strncpy(data->nl, "\n", 1); + strncpy(data->sp, " ", 1); + } } else if (strcmp(elem->defname, "write-in-chunks") == 0) { @@ -383,43 +400,24 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) /* Transaction starts */ OutputPluginPrepareWrite(ctx, true); - if (data->pretty_print) - appendStringInfoString(ctx->out, "{\n"); - else - appendStringInfoCharMacro(ctx->out, '{'); + appendStringInfo(ctx->out, "{%s", data->nl); if (data->include_xids) - { - if (data->pretty_print) - appendStringInfo(ctx->out, "\t\"xid\": %u,\n", txn->xid); - else - appendStringInfo(ctx->out, "\"xid\":%u,", txn->xid); - } + appendStringInfo(ctx->out, "%s\"xid\":%s%u,%s", data->ht, data->sp, txn->xid, data->nl); if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->end_lsn)); - if (data->pretty_print) - appendStringInfo(ctx->out, "\t\"nextlsn\": \"%s\",\n", lsn_str); - else - appendStringInfo(ctx->out, "\"nextlsn\":\"%s\",", lsn_str); + appendStringInfo(ctx->out, "%s\"nextlsn\":%s\"%s\",%s", data->ht, data->sp, lsn_str, data->nl); pfree(lsn_str); } if (data->include_timestamp) - { - if (data->pretty_print) - appendStringInfo(ctx->out, "\t\"timestamp\": \"%s\",\n", timestamptz_to_str(txn->commit_time)); - else - appendStringInfo(ctx->out, "\"timestamp\":\"%s\",", timestamptz_to_str(txn->commit_time)); - } + appendStringInfo(ctx->out, "%s\"timestamp\":%s\"%s\",%s", data->ht, data->sp, timestamptz_to_str(txn->commit_time), data->nl); - if (data->pretty_print) - appendStringInfoString(ctx->out, "\t\"change\": ["); - else - appendStringInfoString(ctx->out, "\"change\":["); + appendStringInfo(ctx->out, "%s\"change\":%s[", data->ht, data->sp); if (data->write_in_chunks) OutputPluginWrite(ctx, true); @@ -443,18 +441,11 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->write_in_chunks) OutputPluginPrepareWrite(ctx, true); - if (data->pretty_print) - { - /* if we don't write in chunks, we need a newline here */ - if (!data->write_in_chunks) - appendStringInfoCharMacro(ctx->out, '\n'); + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks) + appendStringInfo(ctx->out, "%s", data->nl); - appendStringInfoString(ctx->out, "\t]\n}"); - } - else - { - appendStringInfoString(ctx->out, "]}"); - } + appendStringInfo(ctx->out, "%s]%s}", data->ht, data->nl); OutputPluginWrite(ctx, true); } @@ -477,7 +468,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu StringInfoData coltypeoids; StringInfoData colnotnulls; StringInfoData colvalues; - char *comma = ""; + char comma[3] = ""; data = ctx->output_plugin_private; @@ -496,47 +487,22 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu */ if (replident) { - if (data->pretty_print) - { - appendStringInfoString(&colnames, "\t\t\t\"oldkeys\": {\n"); - appendStringInfoString(&colnames, "\t\t\t\t\"keynames\": ["); - appendStringInfoString(&coltypes, "\t\t\t\t\"keytypes\": ["); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "\t\t\t\"keytypeoids\": ["); - appendStringInfoString(&colvalues, "\t\t\t\t\"keyvalues\": ["); - } - else - { - appendStringInfoString(&colnames, "\"oldkeys\":{"); - appendStringInfoString(&colnames, "\"keynames\":["); - appendStringInfoString(&coltypes, "\"keytypes\":["); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "\"keytypeoids\": ["); - appendStringInfoString(&colvalues, "\"keyvalues\":["); - } + appendStringInfo(&colnames, "%s%s%s\"oldkeys\":%s{%s", data->ht, data->ht, data->ht, data->sp, data->nl); + appendStringInfo(&colnames, "%s%s%s%s\"keynames\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); + appendStringInfo(&coltypes, "%s%s%s%s\"keytypes\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); + if (data->include_type_oids) + appendStringInfo(&coltypeoids, "%s%s%s%s\"keytypeoids\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); + appendStringInfo(&colvalues, "%s%s%s%s\"keyvalues\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); } else { - if (data->pretty_print) - { - appendStringInfoString(&colnames, "\t\t\t\"columnnames\": ["); - appendStringInfoString(&coltypes, "\t\t\t\"columntypes\": ["); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "\t\t\t\"columntypeoids\": ["); - if (data->include_not_null) - appendStringInfoString(&colnotnulls, "\t\t\t\"columnoptionals\": ["); - appendStringInfoString(&colvalues, "\t\t\t\"columnvalues\": ["); - } - else - { - appendStringInfoString(&colnames, "\"columnnames\":["); - appendStringInfoString(&coltypes, "\"columntypes\":["); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "\"columntypeoids\": ["); - if (data->include_not_null) - appendStringInfoString(&colnotnulls, "\"columnoptionals\": ["); - appendStringInfoString(&colvalues, "\"columnvalues\":["); - } + appendStringInfo(&colnames, "%s%s%s\"columnnames\":%s[", data->ht, data->ht, data->ht, data->sp); + appendStringInfo(&coltypes, "%s%s%s\"columntypes\":%s[", data->ht, data->ht, data->ht, data->sp); + if (data->include_type_oids) + appendStringInfo(&coltypeoids, "%s%s%s\"columntypeoids\":%s[", data->ht, data->ht, data->ht, data->sp); + if (data->include_not_null) + appendStringInfo(&colnotnulls, "%s%s%s\"columnoptionals\":%s[", data->ht, data->ht, data->ht, data->sp); + appendStringInfo(&colvalues, "%s%s%s\"columnvalues\":%s[", data->ht, data->ht, data->ht, data->sp); } /* Print column information (name, type, value) */ @@ -621,7 +587,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu } /* Accumulate each column info */ - appendStringInfoString(&colnames, comma); + appendStringInfo(&colnames, "%s", comma); escape_json(&colnames, NameStr(attr->attname)); if (data->include_types) @@ -631,14 +597,14 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu char *type_str; type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); - appendStringInfoString(&coltypes, comma); + appendStringInfo(&coltypes, "%s", comma); escape_json(&coltypes, type_str); pfree(type_str); } else { Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); - appendStringInfoString(&coltypes, comma); + appendStringInfo(&coltypes, "%s", comma); escape_json(&coltypes, NameStr(type_form->typname)); } @@ -706,12 +672,12 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&colvalues, "%sfalse", comma); break; case BYTEAOID: - appendStringInfoString(&colvalues, comma); - // XXX: strings here are "\xC0FFEE", we strip the "\x" - escape_json(&colvalues, (outputstr+2)); + appendStringInfo(&colvalues, "%s", comma); + /* string is "\x54617069727573", start after "\x" */ + escape_json(&colvalues, (outputstr + 2)); break; default: - appendStringInfoString(&colvalues, comma); + appendStringInfo(&colvalues, "%s", comma); escape_json(&colvalues, outputstr); break; } @@ -719,68 +685,33 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* The first column does not have comma */ if (strcmp(comma, "") == 0) - { - if (data->pretty_print) - comma = ", "; - else - comma = ","; - } + snprintf(comma, 3, ",%s", data->sp); } /* Column info ends */ if (replident) { - if (data->pretty_print) - { - appendStringInfoString(&colnames, "],\n"); - if (data->include_types) - appendStringInfoString(&coltypes, "],\n"); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "],\n"); - appendStringInfoString(&colvalues, "]\n"); - appendStringInfoString(&colvalues, "\t\t\t}\n"); - } - else - { - appendStringInfoString(&colnames, "],"); - if (data->include_types) - appendStringInfoString(&coltypes, "],"); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "],"); - appendStringInfoCharMacro(&colvalues, ']'); - appendStringInfoCharMacro(&colvalues, '}'); - } + appendStringInfo(&colnames, "],%s", data->nl); + if (data->include_types) + appendStringInfo(&coltypes, "],%s", data->nl); + if (data->include_type_oids) + appendStringInfo(&coltypeoids, "],%s", data->nl); + appendStringInfo(&colvalues, "]%s", data->nl); + appendStringInfo(&colvalues, "%s%s%s}%s", data->ht, data->ht, data->ht, data->nl); } else { - if (data->pretty_print) - { - appendStringInfoString(&colnames, "],\n"); - if (data->include_types) - appendStringInfoString(&coltypes, "],\n"); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "],\n"); - if (data->include_not_null) - appendStringInfoString(&colnotnulls, "],\n"); - if (hasreplident) - appendStringInfoString(&colvalues, "],\n"); - else - appendStringInfoString(&colvalues, "]\n"); - } + appendStringInfo(&colnames, "],%s", data->nl); + if (data->include_types) + appendStringInfo(&coltypes, "],%s", data->nl); + if (data->include_type_oids) + appendStringInfo(&coltypeoids, "],%s", data->nl); + if (data->include_not_null) + appendStringInfo(&colnotnulls, "],%s", data->nl); + if (hasreplident) + appendStringInfo(&colvalues, "],%s", data->nl); else - { - appendStringInfoString(&colnames, "],"); - if (data->include_types) - appendStringInfoString(&coltypes, "],"); - if (data->include_type_oids) - appendStringInfoString(&coltypeoids, "],"); - if (data->include_not_null) - appendStringInfoString(&colnotnulls, "],"); - if (hasreplident) - appendStringInfoString(&colvalues, "],"); - else - appendStringInfoCharMacro(&colvalues, ']'); - } + appendStringInfo(&colvalues, "]%s", data->nl); } /* Print data */ @@ -967,78 +898,43 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Change counter */ data->nr_changes++; - /* Change starts */ - if (data->pretty_print) - { - /* if we don't write in chunks, we need a newline here */ - if (!data->write_in_chunks) - appendStringInfoChar(ctx->out, '\n'); + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks) + appendStringInfo(ctx->out, "%s", data->nl); - appendStringInfoString(ctx->out, "\t\t"); + appendStringInfo(ctx->out, "%s%s", data->ht, data->ht); - if (data->nr_changes > 1) - appendStringInfoChar(ctx->out, ','); + if (data->nr_changes > 1) + appendStringInfoChar(ctx->out, ','); - appendStringInfoString(ctx->out, "{\n"); - } - else - { - if (data->nr_changes > 1) - appendStringInfoString(ctx->out, ",{"); - else - appendStringInfoCharMacro(ctx->out, '{'); - } + appendStringInfo(ctx->out, "{%s", data->nl); /* Print change kind */ switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: - if (data->pretty_print) - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"insert\",\n"); - else - appendStringInfoString(ctx->out, "\"kind\":\"insert\","); + appendStringInfo(ctx->out, "%s%s%s\"kind\":%s\"insert\",%s", data->ht, data->ht, data->ht, data->sp, data->nl); break; case REORDER_BUFFER_CHANGE_UPDATE: - if(data->pretty_print) - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"update\",\n"); - else - appendStringInfoString(ctx->out, "\"kind\":\"update\","); + appendStringInfo(ctx->out, "%s%s%s\"kind\":%s\"update\",%s", data->ht, data->ht, data->ht, data->sp, data->nl); break; case REORDER_BUFFER_CHANGE_DELETE: - if (data->pretty_print) - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"delete\",\n"); - else - appendStringInfoString(ctx->out, "\"kind\":\"delete\","); + appendStringInfo(ctx->out, "%s%s%s\"kind\":%s\"delete\",%s", data->ht, data->ht, data->ht, data->sp, data->nl); break; default: Assert(false); } /* Print table name (possibly) qualified */ - if (data->pretty_print) - { - if (data->include_schemas) - { - appendStringInfoString(ctx->out, "\t\t\t\"schema\": "); - escape_json(ctx->out, get_namespace_name(class_form->relnamespace)); - appendStringInfoString(ctx->out, ",\n"); - } - appendStringInfoString(ctx->out, "\t\t\t\"table\": "); - escape_json(ctx->out, NameStr(class_form->relname)); - appendStringInfoString(ctx->out, ",\n"); - } - else + if (data->include_schemas) { - if (data->include_schemas) - { - appendStringInfoString(ctx->out, "\"schema\":"); - escape_json(ctx->out, get_namespace_name(class_form->relnamespace)); - appendStringInfoCharMacro(ctx->out, ','); - } - appendStringInfoString(ctx->out, "\"table\":"); - escape_json(ctx->out, NameStr(class_form->relname)); - appendStringInfoCharMacro(ctx->out, ','); + appendStringInfo(ctx->out, "%s%s%s\"schema\":%s", data->ht, data->ht, data->ht, data->sp); + escape_json(ctx->out, get_namespace_name(class_form->relnamespace)); + appendStringInfo(ctx->out, ",%s", data->nl); } + appendStringInfo(ctx->out, "%s%s%s\"table\":%s", data->ht, data->ht, data->ht, data->sp); + escape_json(ctx->out, NameStr(class_form->relname)); + appendStringInfo(ctx->out, ",%s", data->nl); switch (change->action) { @@ -1104,10 +1000,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } - if (data->pretty_print) - appendStringInfoString(ctx->out, "\t\t}"); - else - appendStringInfoCharMacro(ctx->out, '}'); + appendStringInfo(ctx->out, "%s%s}", data->ht, data->ht); MemoryContextSwitchTo(old); MemoryContextReset(data->context); @@ -1146,90 +1039,40 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (transactional) data->nr_changes++; - if (data->pretty_print) - { - /* if we don't write in chunks, we need a newline here */ - if (!data->write_in_chunks && transactional) - appendStringInfoChar(ctx->out, '\n'); + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks && transactional) + appendStringInfo(ctx->out, "%s", data->nl); - /* build a complete JSON object for non-transactional message */ - if (!transactional) - { - appendStringInfoString(ctx->out, "{\n"); - appendStringInfoString(ctx->out, "\t\"change\": [\n"); - } - - appendStringInfoString(ctx->out, "\t\t"); - - if (data->nr_changes > 1) - appendStringInfoChar(ctx->out, ','); - - appendStringInfoString(ctx->out, "{\n"); - - appendStringInfoString(ctx->out, "\t\t\t\"kind\": \"message\",\n"); + /* build a complete JSON object for non-transactional message */ + if (!transactional) + appendStringInfo(ctx->out, "{%s%s\"change\":%s[%s", data->nl, data->ht, data->sp, data->nl); - if (transactional) - appendStringInfoString(ctx->out, "\t\t\t\"transactional\": true,\n"); - else - appendStringInfoString(ctx->out, "\t\t\t\"transactional\": false,\n"); - - appendStringInfo(ctx->out, "\t\t\t\"prefix\": "); - escape_json(ctx->out, prefix); - appendStringInfoString(ctx->out, ",\n\t\t\t\"content\": "); + appendStringInfo(ctx->out, "%s%s", data->ht, data->ht); - // force null-terminated string - content_str = (char *)palloc0(content_size+1); - strncpy(content_str, content, content_size); - escape_json(ctx->out, content_str); - pfree(content_str); + if (data->nr_changes > 1) + appendStringInfoChar(ctx->out, ','); - appendStringInfoString(ctx->out, "\n\t\t}"); + appendStringInfo(ctx->out, "{%s%s%s%s\"kind\":%s\"message\",%s", data->nl, data->ht, data->ht, data->ht, data->sp, data->nl); - /* build a complete JSON object for non-transactional message */ - if (!transactional) - { - appendStringInfoString(ctx->out, "\n\t]"); - appendStringInfoString(ctx->out, "\n}"); - } - } + if (transactional) + appendStringInfo(ctx->out, "%s%s%s\"transactional\":%strue,%s", data->ht, data->ht, data->ht, data->sp, data->nl); else - { - /* build a complete JSON object for non-transactional message */ - if (!transactional) - { - appendStringInfoString(ctx->out, "{\"change\":["); - } + appendStringInfo(ctx->out, "%s%s%s\"transactional\":%sfalse,%s", data->ht, data->ht, data->ht, data->sp, data->nl); - if (data->nr_changes > 1) - appendStringInfoString(ctx->out, ",{"); - else - appendStringInfoChar(ctx->out, '{'); - - appendStringInfoString(ctx->out, "\"kind\":\"message\","); + appendStringInfo(ctx->out, "%s%s%s\"prefix\":%s", data->ht, data->ht, data->ht, data->sp); + escape_json(ctx->out, prefix); + appendStringInfo(ctx->out, ",%s%s%s%s\"content\":%s", data->nl, data->ht, data->ht, data->ht, data->sp); - if (transactional) - appendStringInfoString(ctx->out, "\"transactional\":true,"); - else - appendStringInfoString(ctx->out, "\"transactional\":false,"); + content_str = (char *) palloc0((content_size + 1) * sizeof(char)); + strncpy(content_str, content, content_size); + escape_json(ctx->out, content_str); + pfree(content_str); - appendStringInfo(ctx->out, "\"prefix\":"); - escape_json(ctx->out, prefix); - appendStringInfoString(ctx->out, ",\"content\":"); + appendStringInfo(ctx->out, "%s%s%s}", data->nl, data->ht, data->ht); - // force null-terminated string - content_str = (char *)palloc0(content_size+1); - strncpy(content_str, content, content_size); - escape_json(ctx->out, content_str); - pfree(content_str); - - appendStringInfoChar(ctx->out, '}'); - - /* build a complete JSON object for non-transactional message */ - if (!transactional) - { - appendStringInfoString(ctx->out, "]}"); - } - } + /* build a complete JSON object for non-transactional message */ + if (!transactional) + appendStringInfo(ctx->out, "%s%s]%s}", data->nl, data->ht, data->nl); MemoryContextSwitchTo(old); MemoryContextReset(data->context); From 66d836d209f71f2337ea622ae63669d759e30926 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 28 Aug 2018 22:50:07 -0300 Subject: [PATCH 055/154] Revert include-unchanged-toast option Per discussion in issue #74, we can't rely on access unchanged TOAST data because it is not in the WAL stream. It reverts commits 947043e22accdf8276536a5878c34e7984b89916 ce82d7387a806bc8bacaeed80e0a0f1840733dce and d86a13bd788d748f50bf801810c88a51ea96a16c . --- expected/bytea.out | 3 ++- expected/toast.out | 44 +++++++++++++++++++------------------------- sql/bytea.sql | 2 +- sql/toast.sql | 6 +----- wal2json.c | 21 +++------------------ 5 files changed, 26 insertions(+), 50 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 5c032741c22f..e40b91028181 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -22,7 +22,8 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + diff --git a/expected/toast.out b/expected/toast.out index 648ad89b9545..baa43fbb19dc 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -28,7 +28,11 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), -- update of existing column UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); +DELETE FROM xpto WHERE id = 1; +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +WARNING: column "toasted_col2" has an unchanged TOAST +WARNING: column "toasted_col1" has an unchanged TOAST +WARNING: column "toasted_col2" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -89,31 +93,21 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } + ] + } -(4 rows) - -UPDATE xpto SET rand1 = 234.567 WHERE id = 1; --- include-unchanged-toast=1 is the default -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); - data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + - "columntypes": ["int4", "text", "float8", "text", "float8"], + - "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 234.567, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 0.394382926635444],+ - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } -(1 row) +(5 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/bytea.sql b/sql/bytea.sql index e5fe7d2c3ae5..157fc38dcc20 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -18,5 +18,5 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index 4c2c294402c7..1bcede60fc0e 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -27,11 +27,7 @@ UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_s UPDATE xpto SET rand1 = 123.456 WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0', 'include-unchanged-toast', '0'); +DELETE FROM xpto WHERE id = 1; -UPDATE xpto SET rand1 = 234.567 WHERE id = 1; - --- include-unchanged-toast=1 is the default SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); - SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 4761ec02982b..100c0b76bd41 100644 --- a/wal2json.c +++ b/wal2json.c @@ -39,7 +39,6 @@ typedef struct bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ bool include_not_null; /* include not-null constraints */ - bool include_unchanged_toast; /* include unchanged TOAST field values in output */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -140,7 +139,6 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->write_in_chunks = false; data->include_lsn = false; data->include_not_null = false; - data->include_unchanged_toast = true; data->filter_tables = NIL; /* pretty print */ @@ -304,19 +302,6 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } - else if (strcmp(elem->defname, "include-unchanged-toast") == 0) - { - if (elem->arg == NULL) - { - elog(LOG, "include-unchanged-toast is null"); - data->include_unchanged_toast = true; - } - else if (!parse_bool(strVal(elem->arg), &data->include_unchanged_toast)) - ereport(ERROR, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); - } else if (strcmp(elem->defname, "filter-tables") == 0) { char *rawstr; @@ -579,10 +564,10 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (isnull && replident) continue; - if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval) && !data->include_unchanged_toast) + /* XXX Unchanged TOAST Datum does not need to be output */ + if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) { - /* TOAST value is not returned if include-unchanged-toast is specified */ - elog(DEBUG2, "column \"%s\" has an unchanged TOAST - excluding", NameStr(attr->attname)); + elog(WARNING, "column \"%s\" has an unchanged TOAST", NameStr(attr->attname)); continue; } From 2e6384cdfe9e97ece59596b2b46384ed6d248bba Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 28 Aug 2018 23:00:42 -0300 Subject: [PATCH 056/154] Add an error message to include-unchanged-toast parameter Per issue #74, parameter include-unchanged-toast wasn't safe, hence, remove it. Since it is part of release 1.0, deprecate this option for the next release. --- expected/cmdline.out | 2 ++ sql/cmdline.sql | 2 ++ wal2json.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/expected/cmdline.out b/expected/cmdline.out index 2cdb0d9a9b00..f82258dadf6e 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -9,6 +9,8 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); ERROR: option "nosuchopt" = "42" is unknown +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-unchanged-toast', '1'); +ERROR: parameter "include-unchanged-toast" was deprecated -- don't include not-null constraint by default CREATE TABLE table_optional ( a smallserial, diff --git a/sql/cmdline.sql b/sql/cmdline.sql index bab3673b6fed..4dd7c8d56faa 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -7,6 +7,8 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-unchanged-toast', '1'); + -- don't include not-null constraint by default CREATE TABLE table_optional ( a smallserial, diff --git a/wal2json.c b/wal2json.c index 100c0b76bd41..06987eacd3bb 100644 --- a/wal2json.c +++ b/wal2json.c @@ -302,6 +302,12 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-unchanged-toast") == 0) + { + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("parameter \"%s\" was deprecated", elem->defname))); + } else if (strcmp(elem->defname, "filter-tables") == 0) { char *rawstr; From 9e962bad61ef2bfa53747470bac4d465e71df880 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 28 Aug 2018 23:35:37 -0300 Subject: [PATCH 057/154] Make wal2json logging less chatty Suppress the "XXX argument is null" message. Decrease the TOAST message level from WARNING to DEBUG1. Also, decrease some debug message levels. --- expected/bytea.out | 1 - expected/toast.out | 3 --- wal2json.c | 34 +++++++++++++++++----------------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index e40b91028181..019fae36a376 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -23,7 +23,6 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); -WARNING: column "bincol" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + diff --git a/expected/toast.out b/expected/toast.out index baa43fbb19dc..70f24611f25d 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -30,9 +30,6 @@ UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_s UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); -WARNING: column "toasted_col2" has an unchanged TOAST -WARNING: column "toasted_col1" has an unchanged TOAST -WARNING: column "toasted_col2" has an unchanged TOAST data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/wal2json.c b/wal2json.c index 06987eacd3bb..748cc2fa014a 100644 --- a/wal2json.c +++ b/wal2json.c @@ -169,7 +169,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is /* If option does not provide a value, it means its value is true */ if (elem->arg == NULL) { - elog(LOG, "include-xids argument is null"); + elog(DEBUG1, "include-xids argument is null"); data->include_xids = true; } else if (!parse_bool(strVal(elem->arg), &data->include_xids)) @@ -182,7 +182,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-timestamp argument is null"); + elog(DEBUG1, "include-timestamp argument is null"); data->include_timestamp = true; } else if (!parse_bool(strVal(elem->arg), &data->include_timestamp)) @@ -195,7 +195,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-schemas argument is null"); + elog(DEBUG1, "include-schemas argument is null"); data->include_schemas = true; } else if (!parse_bool(strVal(elem->arg), &data->include_schemas)) @@ -208,7 +208,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-types argument is null"); + elog(DEBUG1, "include-types argument is null"); data->include_types = true; } else if (!parse_bool(strVal(elem->arg), &data->include_types)) @@ -221,7 +221,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-type-oids argument is null"); + elog(DEBUG1, "include-type-oids argument is null"); data->include_type_oids = true; } else if (!parse_bool(strVal(elem->arg), &data->include_type_oids)) @@ -234,7 +234,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-typmod argument is null"); + elog(DEBUG1, "include-typmod argument is null"); data->include_typmod = true; } else if (!parse_bool(strVal(elem->arg), &data->include_typmod)) @@ -247,7 +247,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-not-null argument is null"); + elog(DEBUG1, "include-not-null argument is null"); data->include_not_null = true; } else if (!parse_bool(strVal(elem->arg), &data->include_not_null)) @@ -260,7 +260,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "pretty-print argument is null"); + elog(DEBUG1, "pretty-print argument is null"); data->pretty_print = true; } else if (!parse_bool(strVal(elem->arg), &data->pretty_print)) @@ -280,7 +280,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "write-in-chunks argument is null"); + elog(DEBUG1, "write-in-chunks argument is null"); data->write_in_chunks = true; } else if (!parse_bool(strVal(elem->arg), &data->write_in_chunks)) @@ -293,7 +293,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is { if (elem->arg == NULL) { - elog(LOG, "include-lsn argument is null"); + elog(DEBUG1, "include-lsn argument is null"); data->include_lsn = true; } else if (!parse_bool(strVal(elem->arg), &data->include_lsn)) @@ -314,7 +314,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is if (elem->arg == NULL) { - elog(LOG, "filter-tables argument is null"); + elog(DEBUG1, "filter-tables argument is null"); data->filter_tables = NIL; } @@ -342,7 +342,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is if (elem->arg == NULL) { - elog(LOG, "add-tables argument is null"); + elog(DEBUG1, "add-tables argument is null"); data->add_tables = NIL; } else @@ -422,11 +422,11 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, JsonDecodingData *data = ctx->output_plugin_private; if (txn->has_catalog_changes) - elog(DEBUG1, "txn has catalog changes: yes"); + elog(DEBUG2, "txn has catalog changes: yes"); else - elog(DEBUG1, "txn has catalog changes: no"); - elog(DEBUG1, "my change counter: %lu ; # of changes: %lu ; # of changes in memory: %lu", data->nr_changes, txn->nentries, txn->nentries_mem); - elog(DEBUG1, "# of subxacts: %d", txn->nsubtxns); + elog(DEBUG2, "txn has catalog changes: no"); + elog(DEBUG2, "my change counter: %lu ; # of changes: %lu ; # of changes in memory: %lu", data->nr_changes, txn->nentries, txn->nentries_mem); + elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); /* Transaction ends */ if (data->write_in_chunks) @@ -573,7 +573,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* XXX Unchanged TOAST Datum does not need to be output */ if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) { - elog(WARNING, "column \"%s\" has an unchanged TOAST", NameStr(attr->attname)); + elog(DEBUG1, "column \"%s\" has an unchanged TOAST", NameStr(attr->attname)); continue; } From 5d6f7412b10a8d391d6435051ef7b85680750f89 Mon Sep 17 00:00:00 2001 From: Ryan Krage Date: Sat, 20 Oct 2018 12:51:43 -0500 Subject: [PATCH 058/154] Improve perf on deletes when repl ident full --- wal2json.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wal2json.c b/wal2json.c index 748cc2fa014a..53a933f56379 100644 --- a/wal2json.c +++ b/wal2json.c @@ -553,6 +553,13 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu continue; } + /* Get Datum from tuple */ + origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); + + /* Skip nulls iif printing key/identity */ + if (isnull && replident) + continue; + typid = attr->atttypid; /* Figure out type name */ @@ -563,13 +570,6 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* Get information needed for printing values of a type */ getTypeOutputInfo(typid, &typoutput, &typisvarlena); - /* Get Datum from tuple */ - origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); - - /* Skip nulls iif printing key/identity */ - if (isnull && replident) - continue; - /* XXX Unchanged TOAST Datum does not need to be output */ if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) { From 84715c36a158ce1acc20ec7a6262c6e244e49f41 Mon Sep 17 00:00:00 2001 From: Dave Pirotte Date: Fri, 7 Dec 2018 18:24:49 +0000 Subject: [PATCH 059/154] Add tests for include-timestamp option --- Makefile | 2 +- expected/include_timestamp.out | 43 ++++++++++++++++++++++++++++++++++ sql/include_timestamp.sql | 25 ++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 expected/include_timestamp.out create mode 100644 sql/include_timestamp.sql diff --git a/Makefile b/Makefile index 8b1e11185c0b..c97fca477899 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ - filtertable selecttable + filtertable selecttable include_timestamp PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/include_timestamp.out b/expected/include_timestamp.out new file mode 100644 index 000000000000..4243bbd2cb15 --- /dev/null +++ b/expected/include_timestamp.out @@ -0,0 +1,43 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS tbl; +NOTICE: table "tbl" does not exist, skipping +CREATE TABLE tbl (id int); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- One row should have one record and one timestmap +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows should have two records and two timestamps +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows in one transaction should have one record and one timestamp +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/include_timestamp.sql b/sql/include_timestamp.sql new file mode 100644 index 000000000000..93667640f30c --- /dev/null +++ b/sql/include_timestamp.sql @@ -0,0 +1,25 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS tbl; +CREATE TABLE tbl (id int); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +-- One row should have one record and one timestmap +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + +-- Two rows should have two records and two timestamps +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + +-- Two rows in one transaction should have one record and one timestamp +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + From e78a597aa90deabe8405dfbf72efa07accbc9f8a Mon Sep 17 00:00:00 2001 From: Dave Pirotte Date: Fri, 7 Dec 2018 18:25:10 +0000 Subject: [PATCH 060/154] Add tests for include-lsn option --- Makefile | 2 +- expected/include_lsn.out | 42 ++++++++++++++++++++++++++++++++++++++++ sql/include_lsn.sql | 25 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 expected/include_lsn.out create mode 100644 sql/include_lsn.sql diff --git a/Makefile b/Makefile index c97fca477899..4537aad20930 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ - filtertable selecttable include_timestamp + filtertable selecttable include_timestamp include_lsn PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/include_lsn.out b/expected/include_lsn.out new file mode 100644 index 000000000000..102a58d7ea4e --- /dev/null +++ b/expected/include_lsn.out @@ -0,0 +1,42 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS tbl; +CREATE TABLE tbl (id int); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- One row should have one record and one nextlsn +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows should have two records and two nextlsns +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows in one transaction should have one record and one nextlsn +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/include_lsn.sql b/sql/include_lsn.sql new file mode 100644 index 000000000000..de5f7b01c0a1 --- /dev/null +++ b/sql/include_lsn.sql @@ -0,0 +1,25 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS tbl; +CREATE TABLE tbl (id int); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +-- One row should have one record and one nextlsn +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + +-- Two rows should have two records and two nextlsns +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + +-- Two rows in one transaction should have one record and one nextlsn +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + From b8b66ee29983a8097fa95239d46c80f14a9e934d Mon Sep 17 00:00:00 2001 From: Dave Pirotte Date: Fri, 7 Dec 2018 18:25:23 +0000 Subject: [PATCH 061/154] Add tests for include-xids option --- Makefile | 2 +- expected/include_xids.out | 42 +++++++++++++++++++++++++++++++++++++++ sql/include_xids.sql | 25 +++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 expected/include_xids.out create mode 100644 sql/include_xids.sql diff --git a/Makefile b/Makefile index 4537aad20930..c09b4b7a7566 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json # message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ - filtertable selecttable include_timestamp include_lsn + filtertable selecttable include_timestamp include_lsn include_xids PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/include_xids.out b/expected/include_xids.out new file mode 100644 index 000000000000..3ce9096db3b1 --- /dev/null +++ b/expected/include_xids.out @@ -0,0 +1,42 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS tbl; +CREATE TABLE tbl (id int); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- One row should have one record and one xids +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows should have two records and two xids +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + ?column? | ?column? +----------+---------- + t | t +(1 row) + +-- Two rows in one transaction should have one record and one xid +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + ?column? | ?column? +----------+---------- + f | t +(1 row) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/include_xids.sql b/sql/include_xids.sql new file mode 100644 index 000000000000..32305cf3ea9d --- /dev/null +++ b/sql/include_xids.sql @@ -0,0 +1,25 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS tbl; +CREATE TABLE tbl (id int); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +-- One row should have one record and one xids +INSERT INTO tbl VALUES (1); +SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + +-- Two rows should have two records and two xids +INSERT INTO tbl VALUES (2); +INSERT INTO tbl VALUES (3); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + +-- Two rows in one transaction should have one record and one xid +INSERT INTO tbl VALUES (4), (5); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + From de78d00119a91fe76723d1c4a33ee6d68d97cf5a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 8 Jan 2019 15:25:49 +0100 Subject: [PATCH 062/154] Avoid null pointer dereference with empty filter-tables As spotted by clang: wal2json.c:321:21: warning: Dereference of null pointer rawstr = pstrdup(strVal(elem->arg)); ^~~~~~~~~~~~~~~~~ /usr/include/postgresql/11/server/nodes/value.h:54:20: note: expanded from macro 'strVal' --- wal2json.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/wal2json.c b/wal2json.c index 53a933f56379..b8afff39cb9f 100644 --- a/wal2json.c +++ b/wal2json.c @@ -317,17 +317,20 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is elog(DEBUG1, "filter-tables argument is null"); data->filter_tables = NIL; } - - rawstr = pstrdup(strVal(elem->arg)); - if (!string_to_SelectTable(rawstr, ',', &data->filter_tables)) + else { + + rawstr = pstrdup(strVal(elem->arg)); + if (!string_to_SelectTable(rawstr, ',', &data->filter_tables)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } pfree(rawstr); - ereport(ERROR, - (errcode(ERRCODE_INVALID_NAME), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); } - pfree(rawstr); } else if (strcmp(elem->defname, "add-tables") == 0) { From f81bf7af09324da656be87dfd53d20741c01e1e0 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 4 Feb 2019 12:58:32 -0300 Subject: [PATCH 063/154] Add option format-version This option defines which format to use. Only version 1 is currently supported. New formats will be available. --- README.md | 1 + wal2json.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/README.md b/README.md index a045e3bb4cce..bf6c5a714780 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ Parameters * `include-unchanged-toast`: add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. +* `format-version`: defines which format to use. Default is _1_. Examples ======== diff --git a/wal2json.c b/wal2json.c index 53a933f56379..5c2cb0f47910 100644 --- a/wal2json.c +++ b/wal2json.c @@ -17,6 +17,7 @@ #include "replication/logical.h" #include "utils/builtins.h" +#include "utils/guc.h" #include "utils/json.h" #include "utils/lsyscache.h" #include "utils/memutils.h" @@ -24,6 +25,9 @@ #include "utils/rel.h" #include "utils/syscache.h" +#define WAL2JSON_FORMAT_VERSION 1 +#define WAL2JSON_FORMAT_MIN_VERSION 1 + PG_MODULE_MAGIC; extern void _PG_init(void); @@ -46,6 +50,8 @@ typedef struct List *filter_tables; /* filter out tables */ List *add_tables; /* add only these tables */ + int format_version; /* support different formats */ + /* * LSN pointing to the end of commit record + 1 (txn->end_lsn) * It is useful for tools that wants a position to restart from. @@ -141,6 +147,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_not_null = false; data->filter_tables = NIL; + data->format_version = WAL2JSON_FORMAT_VERSION; + /* pretty print */ strcpy(data->ht, ""); strcpy(data->nl, ""); @@ -359,6 +367,31 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is pfree(rawstr); } } + else if (strcmp(elem->defname, "format-version") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "format-version argument is null"); + data->format_version = WAL2JSON_FORMAT_VERSION; + } + else if (!parse_int(strVal(elem->arg), &data->format_version, 0, NULL)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + + if (data->format_version > WAL2JSON_FORMAT_VERSION) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("client sent format_version=%d but we only support format %d or lower", + data->format_version, WAL2JSON_FORMAT_VERSION))); + + if (data->format_version < WAL2JSON_FORMAT_MIN_VERSION) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("client sent format_version=%d but we only support format %d or higher", + data->format_version, WAL2JSON_FORMAT_MIN_VERSION))); + } else { ereport(ERROR, @@ -368,6 +401,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is elem->arg ? strVal(elem->arg) : "(null)"))); } } + + elog(DEBUG2, "format version: %d", data->format_version); } /* cleanup this plugin's resources */ From 8cecf51255f8866ecc49e179e141ffac1cd3cf61 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 4 Feb 2019 18:39:14 +0000 Subject: [PATCH 064/154] Note include-unchanged-toast is deprecated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf6c5a714780..a9f6c5fd8344 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Parameters * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. -* `include-unchanged-toast`: add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. +* `include-unchanged-toast` (deprecated): add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. * `format-version`: defines which format to use. Default is _1_. From b4e7f41395efa787b4c4d6eaae4cc2496357edec Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 4 Feb 2019 23:07:30 -0300 Subject: [PATCH 065/154] remove empty line --- wal2json.c | 1 - 1 file changed, 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index b99484ed2845..35f32bc7deb0 100644 --- a/wal2json.c +++ b/wal2json.c @@ -327,7 +327,6 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is } else { - rawstr = pstrdup(strVal(elem->arg)); if (!string_to_SelectTable(rawstr, ',', &data->filter_tables)) { From f9ee2295156821b439104131423edb647ab9f8ed Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 16 Feb 2019 11:27:18 +0000 Subject: [PATCH 066/154] Add 'cd' command to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a9f6c5fd8344..8f10eedd2468 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Before use this extension, you should build it and load it at the desirable data ``` $ git clone https://github.com/eulerto/wal2json.git +$ cd wal2json $ PATH=/path/to/bin/pg_config:$PATH $ USE_PGXS=1 make $ USE_PGXS=1 make install From 3371f3cf47079252eef4ffea5ac8e4ea1d40521f Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 19 Feb 2019 10:11:23 +0000 Subject: [PATCH 067/154] PATH should contain the parent folder of pg_config --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f10eedd2468..a7fb0c807c87 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ Before use this extension, you should build it and load it at the desirable data ``` $ git clone https://github.com/eulerto/wal2json.git $ cd wal2json -$ PATH=/path/to/bin/pg_config:$PATH +# Make sure your path includes the bin directory that contains the correct `pg_config` +$ PATH=/path/to/pg/bin:$PATH $ USE_PGXS=1 make $ USE_PGXS=1 make install ``` From 9802260d7fd336e96e4778298cd3d25161aed852 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 27 Apr 2019 09:43:23 +0100 Subject: [PATCH 068/154] Fix add-tables to filter single-character schemas --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 35f32bc7deb0..72ba56d9e8d4 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1128,7 +1128,7 @@ parse_table_identifier(List *qualified_tables, char separator, List **select_tab * schema named "*" thus this test should be before we remove the * escape character. */ - if (str[0] == '*' || str[1] == '.') + if (str[0] == '*' && str[1] == '.') t->allschemas = true; else t->allschemas = false; From 926e11f00ce279c34d913c49e78f7becc56fbfd0 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 8 Jun 2019 11:07:21 -0300 Subject: [PATCH 069/154] Add extra_float_digits to tests Postgres commit 02ddd499322ab6f2f0d58692955dc9633c2150fc for v12 and later, changes the default number of trailing digits output for double precision. Add extra_float_digits to keep regression tests stable. --- expected/bytea.out | 1 + expected/delete3.out | 1 + expected/insert1.out | 1 + expected/toast.out | 1 + expected/typmod.out | 1 + expected/update1.out | 1 + expected/update3.out | 1 + expected/update4.out | 1 + sql/bytea.sql | 1 + sql/delete3.sql | 1 + sql/insert1.sql | 1 + sql/toast.sql | 1 + sql/typmod.sql | 1 + sql/update1.sql | 1 + sql/update3.sql | 1 + sql/update4.sql | 1 + 16 files changed, 16 insertions(+) diff --git a/expected/bytea.out b/expected/bytea.out index 019fae36a376..60b7faf0a0be 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; SELECT setseed(0); setseed diff --git a/expected/delete3.out b/expected/delete3.out index 9824f15ba378..7c17a5f572d6 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; DROP TABLE IF EXISTS table_with_unique; diff --git a/expected/insert1.out b/expected/insert1.out index d568afbaf438..be9e247d1b2a 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -3,6 +3,7 @@ LOAD 'test_decoding'; \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; CREATE TABLE table_with_pk ( a smallserial, b smallint, diff --git a/expected/toast.out b/expected/toast.out index 70f24611f25d..f21670c3458e 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; SELECT setseed(0); setseed diff --git a/expected/typmod.out b/expected/typmod.out index 82473fa70cde..c11969644174 100644 --- a/expected/typmod.out +++ b/expected/typmod.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; CREATE TABLE table_with_pk ( a smallserial, diff --git a/expected/update1.out b/expected/update1.out index e9b2140cfe88..132eb968d6c8 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; DROP TABLE IF EXISTS table_with_unique; diff --git a/expected/update3.out b/expected/update3.out index 9cf2a6f278b3..4723b3fec3c3 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; DROP TABLE IF EXISTS table_with_unique; diff --git a/expected/update4.out b/expected/update4.out index 957f5d69e09a..ad140dc00383 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -1,6 +1,7 @@ \set VERBOSITY terse -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_unique; CREATE TABLE table_with_unique ( a smallserial, diff --git a/sql/bytea.sql b/sql/bytea.sql index 157fc38dcc20..94a5dd3deb3b 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; diff --git a/sql/delete3.sql b/sql/delete3.sql index f32f969843f9..f596b61e76c9 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; diff --git a/sql/insert1.sql b/sql/insert1.sql index 8d78dbb9dc7a..c047c12b3f6b 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -5,6 +5,7 @@ LOAD 'test_decoding'; -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; CREATE TABLE table_with_pk ( a smallserial, diff --git a/sql/toast.sql b/sql/toast.sql index 1bcede60fc0e..a3eb63a1425d 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; diff --git a/sql/typmod.sql b/sql/typmod.sql index 33b323709062..15ba8ceb26c4 100644 --- a/sql/typmod.sql +++ b/sql/typmod.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; diff --git a/sql/update1.sql b/sql/update1.sql index 83485ad142df..4e7d20a71b30 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; diff --git a/sql/update3.sql b/sql/update3.sql index d28054ed10bd..402af7e2d503 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_pk; DROP TABLE IF EXISTS table_without_pk; diff --git a/sql/update4.sql b/sql/update4.sql index 9c77162219f4..ef812610471e 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; +SET extra_float_digits = 0; DROP TABLE IF EXISTS table_with_unique; From 1daa0b67dfe2e0297ce7633d34091b5390d56fbf Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 3 Aug 2019 22:52:54 -0300 Subject: [PATCH 070/154] Filter messages by prefix The new parameter 'filter-msg-prefixes' filters messages with those prefixes. It a comma separated value. By default no messages are filtered. Per off-list discussion with @martinmarques --- README.md | 1 + expected/message.out | 14 +++++- sql/message.sql | 4 +- wal2json.c | 105 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7fb0c807c87..158a3144687a 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Parameters * `include-unchanged-toast` (deprecated): add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. +* `filter-msg-prefixes`: exclude messages if prefix is in the list. Default is empty which means that no message will be filtered. It is a comma separated value. * `format-version`: defines which format to use. Default is _1_. Examples diff --git a/expected/message.out b/expected/message.out index dceacea512a8..c190377cdb43 100644 --- a/expected/message.out +++ b/expected/message.out @@ -71,7 +71,13 @@ SELECT 'msg10' FROM pg_logical_emit_message(true, 'wal2json', 'this is message # (1 row) COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT 'msg11' FROM pg_logical_emit_message(true, 'filtered', 'this message will be filtered'); + ?column? +---------- + msg11 +(1 row) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar'); data --------------------------------------------------------------------------------------------------------- { + @@ -160,7 +166,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } + ] + } -(8 rows) + { + + "change": [ + + ] + + } +(9 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/message.sql b/sql/message.sql index ebaa5fef2a48..27bf30b2c140 100644 --- a/sql/message.sql +++ b/sql/message.sql @@ -23,6 +23,8 @@ SELECT 'msg9' FROM pg_logical_emit_message(false, 'wal2json', 'this message will SELECT 'msg10' FROM pg_logical_emit_message(true, 'wal2json', 'this is message #2'); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT 'msg11' FROM pg_logical_emit_message(true, 'filtered', 'this message will be filtered'); + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 35f32bc7deb0..c86dc63cdd78 100644 --- a/wal2json.c +++ b/wal2json.c @@ -49,6 +49,7 @@ typedef struct List *filter_tables; /* filter out tables */ List *add_tables; /* add only these tables */ + List *filter_msg_prefixes; /* filter by message prefixes */ int format_version; /* support different formats */ @@ -94,6 +95,7 @@ static void pg_decode_message(LogicalDecodingContext *ctx, static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); +static bool split_string_to_list(char *rawstring, char separator, List **sl); void _PG_init(void) @@ -146,6 +148,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_lsn = false; data->include_not_null = false; data->filter_tables = NIL; + data->filter_msg_prefixes = NIL; data->format_version = WAL2JSON_FORMAT_VERSION; @@ -369,6 +372,29 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is pfree(rawstr); } } + else if (strcmp(elem->defname, "filter-msg-prefixes") == 0) + { + char *rawstr; + + if (elem->arg == NULL) + { + elog(DEBUG1, "filter-msg-prefixes argument is null"); + data->filter_msg_prefixes = NIL; + } + else + { + rawstr = pstrdup(strVal(elem->arg)); + if (!split_string_to_list(rawstr, ',', &data->filter_msg_prefixes)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + pfree(rawstr); + } + } else if (strcmp(elem->defname, "format-version") == 0) { if (elem->arg == NULL) @@ -1053,6 +1079,23 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* Avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); + /* Filter message prefixes, if available */ + if (list_length(data->filter_msg_prefixes) > 0) + { + ListCell *lc; + + foreach(lc, data->filter_msg_prefixes) + { + char *p = lfirst(lc); + + if (strcmp(p, prefix) == 0) + { + elog(DEBUG2, "message prefix \"%s\" was filtered out", p); + return; + } + } + } + /* * write immediately iif (i) write-in-chunks=1 or (ii) non-transactional * messages. @@ -1255,3 +1298,65 @@ string_to_SelectTable(char *rawstring, char separator, List **select_tables) return true; } + +static bool +split_string_to_list(char *rawstring, char separator, List **sl) +{ + char *nextp; + bool done = false; + + nextp = rawstring; + + while (isspace(*nextp)) + nextp++; /* skip leading whitespace */ + + if (*nextp == '\0') + return true; /* allow empty string */ + + /* At the top of the loop, we are at start of a new identifier. */ + do + { + char *curname; + char *endp; + char *pname; + + curname = nextp; + while (*nextp && *nextp != separator && !isspace(*nextp)) + { + if (*nextp == '\\') + nextp++; /* ignore next character because of escape */ + nextp++; + } + endp = nextp; + if (curname == nextp) + return false; /* empty unquoted name not allowed */ + + while (isspace(*nextp)) + nextp++; /* skip trailing whitespace */ + + if (*nextp == separator) + { + nextp++; + while (isspace(*nextp)) + nextp++; /* skip leading whitespace for next */ + /* we expect another name, so done remains false */ + } + else if (*nextp == '\0') + done = true; + else + return false; /* invalid syntax */ + + /* Now safe to overwrite separator with a null */ + *endp = '\0'; + + /* + * Finished isolating current name --- add it to list + */ + pname = pstrdup(curname); + *sl = lappend(*sl, pname); + + /* Loop back if we didn't reach end of string */ + } while (!done); + + return true; +} From cfe3846a48e9a975816273f017d5bda4d658c513 Mon Sep 17 00:00:00 2001 From: David Fetter Date: Tue, 6 Aug 2019 12:41:57 -0700 Subject: [PATCH 071/154] Updated copyright to 2019 --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 9f3b300a308d..9e92c789a534 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2018, Euler Taveira de Oliveira +Copyright (c) 2013-2019, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index 158a3144687a..3fc5a4cd6be9 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ stop License ======= -> Copyright (c) 2013-2018, Euler Taveira de Oliveira +> Copyright (c) 2013-2019, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index c86dc63cdd78..3468c3466e37 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2018, Euler Taveira de Oliveira + * Copyright (c) 2013-2019, Euler Taveira de Oliveira * * IDENTIFICATION * contrib/wal2json/wal2json.c From 26774a4e9992f6f84226bbb3282e108a363339e4 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 6 Aug 2019 19:36:27 -0300 Subject: [PATCH 072/154] Add messages by prefix The new parameter 'add-msg-prefixes' adds only messages with these prefixes. It is a comma separated value. By default all messages are included. wal2json enforces this rule after 'filter-msg-prefixes'. Per off-list discussion with @martinmarques --- README.md | 1 + expected/message.out | 30 +++++++++++++++++++++++++++-- sql/message.sql | 4 +++- wal2json.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 158a3144687a..c12592368d63 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Parameters * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. * `filter-msg-prefixes`: exclude messages if prefix is in the list. Default is empty which means that no message will be filtered. It is a comma separated value. +* `add-msg-prefixes`: include only messages if prefix is in the list. Default is all prefixes. It is a comma separated value. `wal2json` applies `filter-msg-prefixes` before this parameter. * `format-version`: defines which format to use. Default is _1_. Examples diff --git a/expected/message.out b/expected/message.out index c190377cdb43..6b36d4892786 100644 --- a/expected/message.out +++ b/expected/message.out @@ -77,7 +77,19 @@ SELECT 'msg11' FROM pg_logical_emit_message(true, 'filtered', 'this message will msg11 (1 row) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar'); +SELECT 'msg12' FROM pg_logical_emit_message(true, 'added1', 'this message will be printed'); + ?column? +---------- + msg12 +(1 row) + +SELECT 'msg13' FROM pg_logical_emit_message(true, 'added2', 'this message will be filtered'); + ?column? +---------- + msg13 +(1 row) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); data --------------------------------------------------------------------------------------------------------- { + @@ -170,7 +182,21 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre "change": [ + ] + } -(9 rows) + { + + "change": [ + + { + + "kind": "message", + + "transactional": true, + + "prefix": "added1", + + "content": "this message will be printed" + + } + + ] + + } + { + + "change": [ + + ] + + } +(11 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/message.sql b/sql/message.sql index 27bf30b2c140..3bfa3daeb5fc 100644 --- a/sql/message.sql +++ b/sql/message.sql @@ -24,7 +24,9 @@ SELECT 'msg10' FROM pg_logical_emit_message(true, 'wal2json', 'this is message # COMMIT; SELECT 'msg11' FROM pg_logical_emit_message(true, 'filtered', 'this message will be filtered'); +SELECT 'msg12' FROM pg_logical_emit_message(true, 'added1', 'this message will be printed'); +SELECT 'msg13' FROM pg_logical_emit_message(true, 'added2', 'this message will be filtered'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index c86dc63cdd78..31b0fb004697 100644 --- a/wal2json.c +++ b/wal2json.c @@ -50,6 +50,7 @@ typedef struct List *filter_tables; /* filter out tables */ List *add_tables; /* add only these tables */ List *filter_msg_prefixes; /* filter by message prefixes */ + List *add_msg_prefixes; /* add only messages with these prefixes */ int format_version; /* support different formats */ @@ -149,6 +150,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_not_null = false; data->filter_tables = NIL; data->filter_msg_prefixes = NIL; + data->add_msg_prefixes = NIL; data->format_version = WAL2JSON_FORMAT_VERSION; @@ -395,6 +397,29 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is pfree(rawstr); } } + else if (strcmp(elem->defname, "add-msg-prefixes") == 0) + { + char *rawstr; + + if (elem->arg == NULL) + { + elog(DEBUG1, "add-msg-prefixes argument is null"); + data->add_msg_prefixes = NIL; + } + else + { + rawstr = pstrdup(strVal(elem->arg)); + if (!split_string_to_list(rawstr, ',', &data->add_msg_prefixes)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + pfree(rawstr); + } + } else if (strcmp(elem->defname, "format-version") == 0) { if (elem->arg == NULL) @@ -1096,6 +1121,27 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } } + /* Add messages by prefix */ + if (list_length(data->add_msg_prefixes) > 0) + { + ListCell *lc; + bool skip = true; + + foreach(lc, data->add_msg_prefixes) + { + char *p = lfirst(lc); + + if (strcmp(p, prefix) == 0) + skip = false; + } + + if (skip) + { + elog(DEBUG2, "message prefix \"%s\" was skipped", prefix); + return; + } + } + /* * write immediately iif (i) write-in-chunks=1 or (ii) non-transactional * messages. From fc4c2af215ad647e62b3ba40f60cecab527bb460 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 6 Aug 2019 20:07:12 -0300 Subject: [PATCH 073/154] Update instructions Since version 10, we don't need to adjust parameters. Also, pg_hba.conf changes its behavior. It matches normal connections instead of (physical) replication connections. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15b2cb5df419..22f749a860ef 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ max_replication_slots = 1 After changing these parameters, a restart is needed. +By default, PostgreSQL 10 or later doesn't need to adjust parameters. + Parameters ---------- @@ -87,14 +89,20 @@ There are two ways to obtain the changes (JSON objects) from **wal2json** plugin pg_recvlogical -------------- -Besides the configuration above, it is necessary to configure a replication connection to use pg_recvlogical. +Besides the configuration above, it is necessary to configure a replication connection to use pg_recvlogical. A logical replication connection in version 9.4, 9.5, and 9.6 requires `replication` keyword in the database column. Since version 10, logical replication matches a normal entry with a database name or keywords such as `all`. -First, add a replication connection rule at pg_hba.conf: +First, add a replication connection rule at pg_hba.conf (9.4, 9.5, and 9.6): ``` local replication myuser trust ``` +If you are using version 10 or later: + +``` +local mydatabase myuser trust +``` + Also, set max_wal_senders at postgresql.conf: ``` From 1b0cbac484f4fe5db80445f6721957511b4de7b7 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 15 Dec 2019 10:56:59 -0300 Subject: [PATCH 074/154] New wal2json format This is a new format for wal2json. You can choose it using option 'format-version' = 2. This format is completely different from version 1. Features are: * one JSON per tuple; * each JSON has an "action" (BEGIN, COMMIT, INSERT, UPDATE, DELETE, MESSAGE); * one (optional) JSON object for BEGIN/COMMIT; * BEGIN contains xid, timestamp, and lsn; * COMMIT contains xid, timestamp, and lsn; * INSERT/UPDATE/DELETE contains lsn, schema, table, columns, identity; * "columns" and "identity" are arrays of elements; * each "columns" element is an object that contains name, type, value, and optional; * "identity" is an array of elements (REPLICA IDENTITY for UPDATE / DELETE statements) that contains name, type, and value; * MESSAGE contains xid, timestamp, lsn, transactional, prefix, and content. This new format solves the big transaction issue (that consumes a lot of memory) since tuples aren't accumulate until the end of transaction to be written. Users can control transactions using option include-transaction that will emit a JSON at the beginning of the transaction and another one at the end of the transaction. --- expected/bytea.out | 16 +- expected/cmdline.out | 10 +- expected/delete1.out | 16 +- expected/delete2.out | 28 +- expected/delete3.out | 31 +- expected/delete4.out | 17 +- expected/filtertable.out | 44 ++- expected/include_lsn.out | 6 +- expected/include_timestamp.out | 6 +- expected/include_xids.out | 6 +- expected/insert1.out | 13 +- expected/message.out | 27 +- expected/savepoint.out | 2 +- expected/selecttable.out | 29 +- expected/specialvalue.out | 2 +- expected/toast.out | 22 +- expected/typmod.out | 4 +- expected/update1.out | 19 +- expected/update2.out | 28 +- expected/update3.out | 28 +- expected/update4.out | 17 +- sql/bytea.sql | 3 +- sql/cmdline.sql | 10 +- sql/delete1.sql | 3 +- sql/delete2.sql | 3 +- sql/delete3.sql | 3 +- sql/delete4.sql | 3 +- sql/filtertable.sql | 3 +- sql/include_lsn.sql | 6 +- sql/include_timestamp.sql | 6 +- sql/include_xids.sql | 6 +- sql/insert1.sql | 3 +- sql/message.sql | 3 +- sql/savepoint.sql | 2 +- sql/selecttable.sql | 3 +- sql/specialvalue.sql | 2 +- sql/toast.sql | 3 +- sql/typmod.sql | 4 +- sql/update1.sql | 3 +- sql/update2.sql | 3 +- sql/update3.sql | 3 +- sql/update4.sql | 3 +- wal2json.c | 691 ++++++++++++++++++++++++++++++++- 43 files changed, 1066 insertions(+), 74 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 60b7faf0a0be..6f149b158606 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -23,7 +23,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + @@ -71,6 +71,20 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (3 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":0.230543947778642},{"name":"bincol","type":"bytea","value":"0420019803930402045901000170038901410282024303210187026304890472032803710073031500080127007204210082021000680057052701150272044603260158034002800265052201570416028404170217048401540192044105030038052102890047010603670493019400360011025500350133054505070479015003050212043102910380030300220250053405340415016404260370020503990096025605130484019301340524020604040564034803890509026105500237048604090546028901300572055500890533038802620377017104790188027401390115017003430257010505610064007803080474061405840428024004710232018501470369015500970465008005050105047600480609003403350113015505150474042506280416049500610088034000510046013403040540037804990034010506640136059300840667003605830049000306210400012201100265061905570244037603950309047000680364052002090684039806060517043600250520058006450610058106860521063406910469035101160587062900550461017604480163050002270235016600530455016104690369070202030396052200820343043206890330024606210319000202540441061501730500035803580227053001360464003103100521050504790261013904590474055202490561015307000521049801960407006702000673052700720086027904450459051602240602022402560148076800030647026001480343075307230603055200960542030406140749072806860162063304380238072507300702040104640131022106990398037606880403023701470558059401140493040306870595014601830411010001140298026907730754051706960682041402800330055105100217012700610091054603070244028000770362079304960226056106500416013407560536044401790480036707150340021102820632055408550294078101190358000506850678025701010760063400430396087006250186041907670083008803400269058507220118004600480410070006210398010705310522047805380328027608060433015405550479056405440214075900640091084801560443020807620268033008120319075506120034023907250583078002880207018505740103063307350677018903780298041002190365050501470528001403620364029107040249062205290882065907780671030006230006051508160599062305030389035206990781066101490032006206710184060706880558000100060301025806480848017903380662087306490312088101860157050308290676090601920396071008740551074509410235093705580946050105610954081308290606067010160956033208950604065407800797081802710623048601720823089509040689042806360621067205610155060400340733054308730540011805150537005108580406067304780152043702620432001907630610086606210477051010640063008006870641023902360678099507950499047409191031102809750832036205830238052010350509096610570201050208550841099302830838106103660444061906130688021105300399072610180234067509640122041702220723066307580668006606300634027300210388001010430680087210041057019605080554090407271100017703341007041810290856054503131087014109960717082810660212032601930235072502040147026411000016018701400539075710690118071900830461058205130344028710740667022500410510096208910422118300420621023907870833039010600772040800600917096208370818108503760904035809740228071300650123019002950165071400701080114900681126057103130716020607140583099811340646071408960277032507800663002111490429025406460496038108430801055103340875041402670947032208540020105710670753040308380662106603150323009206491123077206711039121409330436045700560030000606200373090310470648059701000244062011840056010803150915078701201239111902140615097910060009075009550965119801251025123201320358031210580124097703630227122909980127128911120449091206020573086304280794017201080501018208760152117007750281089007050417125910260163005106890535028406070215041405830007087501700623011410541063092612321175008500640716024112620149052808130871095607370556112507911263030410830514052501341112053310301288117211480987087807140865069608030933004110510834019302010273108411791027025709330438014812460143067403800281040509261334031307151099132302010417079409131239033009570894118411571101004108420881109111070407011012600248025705160636054409310145046912530876015011641083057705310571039408690099130906281281098206710687042603270359084304400184109707030712028212610196043102720004132704261193096010150259006614201148016712770308147607970993069312341330106106050289125202311008048505200798068609611077069108140009040502891046067003570987033105290779064605210077014312291336150107930433027505480670130410441202059102150653015809211485016813360245123504820610070308211150149914820137003200821392139500620651028603421211097001150719063807180940130608810316125810540112151007460604056314641443016314201381030314551467014212991533080600070299045609960416119000581149055813900455088210781530099810200693001415970583148501590425128804680300117606140011112714370019143302861035024015001096141204480890025213480363018407381404089107531400148706331565028503080405059115061032060410120852062408271145003010731023114708601482040011191200077013080293054005551061030304060041023006970354064413010217002202431249089008790415037709111509142103960703124708040156078315911489108304510364047107610778051409971489087616541113109816791363066508810551108912661480091410010171163205560990007513540891159107361352024012170402103200141417081909051371022002901347160809680507043103370055019512681075037011851643137912631273053611320270015813781510056706711526025015060688164517320984125216040202000002740545005604740062115008511268104504750774056010220143083611851546058617640441034902290181104901090148025613831780046213850260101714450743108208101610056500640285135406341325150214850716125902640691171006200925007316891037022401240617020505930195047016291664122708960653102714720720131910091365082406921031155401251302040800120081135000861799055003140068117805240672137810030465120703851377000414301005073609010158025017410862129914450990074418621004082713531093077100271415084112250057152607341077010500651470150500691026062608180039078810731809166604871370076412431352178601710814098309550842050318120166056214420913165715510980122511521052033817911885037806581041028004131538167311910860110610621036193401150059084306261900101411981412194309271032098202140243009105570099004109430768109912281189069209570427156701071507064500941626070509510283065319821501010319720457115109830675140010771242150211200205028602391452149409420424193005300533145711860630110119041597139005561598090006611585136618310564003212321658129307340771150310251015094905121973138104380479192419171684052709971578010603660100172912810771129206200581186606531833149819670523022514371565125603400024119717430469168516310347132700971359085802051733096119600957174511941588025510080168003104440078056206731536006119481884008510711560056106851118091420331218019208031428195117791312081614430415031717041438048817381890056801910455000702530310191903401398137709102095038418392030162020360713093518820381012905731846055008951433200913911051178219691247009519791506041017731853182910150620179814060325169608870226025618382135064319710548034403581457179902210693069020290511195621280336130203622135099600300979162618540214195813831114219016450781215900990580051604480944199500681169049207671018101105400965135318601334130306551367007800841027029520700206142520661874221920291977057903220200153701090269048606081047152016341596025607631238160920851904074721671992178902151838200016601677164416521476138822411804159315361917186820310266066113021922000615640422126109190257091316780173065112100390022909532073193003311459113617391439067110600700031706560460058713271780023213351061066003071995092212331386109818950300149521291266127917681603043805991044189712802119028116040457074822011803021901040822129507731134097817080043004104791963034519941776162909431219090313881828196209560770175412430036221920022266168422260008015211730791130221660150134722100635096201850279038418361235161903700259108823581228187017490099190916072127181409211989182410760781022823970574038013610408102523370596130803190046014919600421041106480393165601242165175820581373149114732308108008950972187311260969002315132348043701162280104114410165108915942150151620130363191612440489166005740121059920841613048007230062146501591203244801820272236206250390220616801850237603120993208118470555245113111815046805112398059211192026222616060271229206000432102005850617129704811251169302150452106701180768207322250133013022011460196801651980188507650598142105022225169703020313213613350906023801231395150418371614196403871735020924861453034400821143182220741311128514402087189203320048159720500354191616601706027919031832169108681133076502941525252305061477142808551561001601281089134314292548088007670307093023842382129017421481043120270820228611511699084319271998238818862513128707350781026707520912137021122359134303970529165613400331145500322094033904691529117001630075026910162025229108071309220921102054037023830184129311372322104424970087158115341443191703651477139207081953029218932120036821670496241718311313108614090790050417850539069104301690037414871549046304170431192323570800074410911517004113880753218617610262000615222115133426220853213504432659268311430402169815221907056619912331100212352014181319880412064120331816140315330886166915412427109201732362195623330090192423241246233313160058153418902072116101720588046320062600088026561918271813350727087202792286057913842464021806122073030925581670157021620243163009552155096421302332156026001595142207231511059106990089132615810371086121691771057223922391266927072195157415101595182103682562121013441924077301251758238615632491111421620396120506991995158215711380056321510987016720380909238608132437118126552812095010571348007018401477184814240228153625522414193809380287111925381875251602671209067204360425159200011247120811951081119921572151256322301155120012402596143127942315100818900398129901540094032526970364154805050806197921150808036104572017145416691314074413750682191225901936164611461869109321660884149605821040159209110865196224771376277915710606068819381068272704962756114212481231183302630929087019272088275901071352072716191942177902982865265522822436111121541087172428520105280526680607264808781869094627312136188606601131104304931240241112282878141500660219134827492525084409071735194326501648205225141370266722162259157901942040075721002709190101700223016926061464008610461532030724101316285802662233161522301912027813011449166309900681093825870877300003413000272522630157295224352791141325240827296328370237126826990506049613022760242815851043085802292044154611761618243411651965242208731205258408070617235522360115013921762981037804012652089009030909061602922510167011592744066727220864230221112042121414842926243310170664305903142923009404552038001808372446269717370268052523610563306109521735273616271385051008510415257320781914242314292943309614080151293815040610188315241456123511290090150716602474207716260310070212611954210217772816252212421781132005510086115305371508130603603028192422611421024603592562033718811086283608242729315215330844196704942639164730420729027912091286036623751830188905222194177224651301002827161665261630590381052927391214009627342763094715300071041831953143115502811167245506510364110025590891011011420172142411712914310706002791027911342340150412321882107421890205114626140204109205530488227230321145264109110494030610241647048024622831018023570194299726401339211409122584076419961543097231550926117910021486167300351285283027012207006430123242172702292459131304101565151101590954286422941876219330670609046707650507140219561520290303551556091032120988313832800731311417250962229630531377057212731540153608550545011930700328073302281101124616443077278112540115103021740031202920160013276818301754040908141502180013932788001629440313056730670068089804640298201017221958176711783226188422192067191709110744193203452591034107580051185725751456130425941058162131690780169107021249199427322988059111350797046330383037255015870570330301470919252804911685258223660887065502840105172319213303251202230608036622363365338228351101077533050752042324632354099923782505192715073003020206871965109813482254120530880760110421890986171925613243167525342663278833172554010202991593247713070541155432532062112900032757311311100659192823270311269634442520022517121636002734040721271427450593181728500896342518712216049134412014257310962019186807483141253426941998285019211977189721500206004921790137077614142907137532482275228031960653100401800610303727761717155811432473120601771670322230520082169114402251190014900919204022742346143701262086019424261769085334411952146929621206320209862360214822032540027918992065036200473519263419641462356304590191236519080318090121052766268729672665108208742077230005253072110026921713007829750043216133430091212124112072000324112536019612010864051721112989330712192379239223113263088010230184036721332899209622142286214107762040223429160850070229213283326131210868050500142999352033500595228621282927194030180320212733912472140818611059006703721843212526261132298433360423264129693570351934813588288333703304348620121785277203001159309724460905191701932783298702613161116624032128230817301808273607061115264905640935257634720640221432932669031823912974148718121740240100411935150130532200097905190912312628472657123518913372236008430221330534413723022719503318291822722001218800400096020924610137216102383215063912253741156006332869049318781029014305091879036700881596036503173563371132602096196917052138206819180854220703291094168009742329168025472969079730471086183531941601373135661691155701502011136201021508347620873229183903781368270126031701000504972684235421911448154229960712263910370121044109853716214625560052035701110154187836162259130916472641269005421438057505481940328229210315090706403336162633000542174937481536165120670266170424280378186104700169028417911829294706442377053812252931249406692012281415852659230832252116285711172020053127820228079906222676118024983152135127861073319618701723170424132959076610343636279538711337157723000687371112771814184418130711207526201339086238123858012512612752120705650719294422833152200530570271174519480245309435392563379033483853168512721745240333650447375402940345370004201617252916372187325606540537248226753618275704781626300635971232162834550642154611891925330736121346375934251643013531802068176517533719397110530398053135553094019123483578183013883214307330302704372205943904166639273545302437152996067838542196276216273964250216181015290421540583200823492950159501740329081232713383353729983984344506493913298836973625197403463475015131301077010416122708112804940835171625183203064000763380097208952624032504031588028138752243016128261906381507522257325209041343026810102968299821473468384138781929299104442007231714232910087617523318247720363133064722001889256919502648074611293561210014000478098703162642037500792442231930932891022913160213316121991978238705774031142412302127332938194094187104441104132925602515181235572835033839382917279821361894157023693220178614081291378038151873369210993113168302982806165121833255276435241674113611861093399315280892276501773045050217591258374635592678087031902342275827293451171102413754035119041766363104981124112616422320222814683861312800544042199505591612326401270991175510044205411637832743338112932987294716480687050610851189163922202845397702380097363933890151348011670715087002190843186919881855186418931423038310542727339340230139408802831231103519353468390116843710400110902865415703324043061412094267146330922001333306993909049410850696324102250468338300600754034111032703383507450112328504851210188003781546165709962765165724711581367315272286330820253381401109813609017400773673093304210470365742831220377232741709067108452091222925153096068741851256227935552795024825530499365422561487295024321566230733741991278227111957401321620904138428391756349207294290225414214147352037173366197239701573247632843846397618851925118242100949318826373680078122991478169236954338346228270687339507092118318242551469218018481072376543434379324039481878077707361713173339474370103003252276251920291584247311000014316601000728088033050590236010762451344104402397342237031942088200522685260817972222257028362552042109300152201734211260203321621361276830490236336409721319137744381763379134251030128543151083399024762893176005951279433110202216001130521185127906213362265034081951288923122931422036992912150730271870254543241720363738464215205311200315334209771342106909884416226322770533113804343965310433441779153930760985447200734034183426363864356717713209328338394339360326720791042037511786032814924080086426394520031212193342210327701891309627221967260600150066194036071849061323541154041914183845121518433056301521744560255330452646253033623875131809032086322440210245062220620261068840173892255000461672371304683102299116920361147101282549146126981013412606414398342219680700091306030135116112292211142419221637072444911684240836082156090619943861127034763992383703162077022444692723001432780067071941990674085607261911308221603848008328903719177906622698395115750049318128543548254020553868463322823702270922982334277830231890345838872622070723140120458123993030364441913699167734830598172719973471060845560848450145263146353325570761118406533805308841343014102301400636114400403051419537092556320506821346380924213357258330343221343928413052188016700897264828641555174512390981004322691123068334231165375429040153158313840840293904693277156830691579005617774439312736711363403215764247083633340730182533803015295640691690413030764614428746721232035728531704365544320011046244911800014228530706151521212293099629640854173100054256476729803552166823351846150718451741274822054614446510724264447815383970147416822023218532074159449442122319053011292326481410960494355927762845058342944704233622222085213918743165158715364715073530211561277203704790210600394175444205720455192505551558242341384353042247273810028722111177238543653064069710894612056518302775213646203149207318583190138914413768184833794329341709263600290513513462184116410788302740420277120847461374094204093216373525582954199346464826028711291359407929904760351515070770221444312130077013563782156344032918184406852760322716333173152404510806449824570536440927471673083019034683066704871247144227150748358634922113243301041581040619592272318302383917140617724373221813241872275907834638444416191573417622912064044737444797120023653323332748153429492002300406221134330646"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"xpto","identity":[{"name":"id","type":"integer","value":1}]} + {"action":"C"} +(9 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/cmdline.out b/expected/cmdline.out index f82258dadf6e..1596c7aa3190 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -7,9 +7,9 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js init (1 row) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'nosuchopt', '42'); ERROR: option "nosuchopt" = "42" is unknown -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-unchanged-toast', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-unchanged-toast', '1'); ERROR: parameter "include-unchanged-toast" was deprecated -- don't include not-null constraint by default CREATE TABLE table_optional ( @@ -22,7 +22,7 @@ INSERT INTO table_optional (b, c) VALUES(NULL, TRUE); UPDATE table_optional SET b = 123 WHERE a = 1; DELETE FROM table_optional WHERE a = 1; DROP TABLE table_optional; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'include-not-null', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0', 'include-not-null', '1'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"change":[]} @@ -35,14 +35,14 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0'); data --------------- {"change":[]} {"change":[]} (2 rows) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'write-in-chunks', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0', 'write-in-chunks', '1'); data ------------- {"change":[ diff --git a/expected/delete1.out b/expected/delete1.out index db93d327aa45..ba39853ac37b 100644 --- a/expected/delete1.out +++ b/expected/delete1.out @@ -76,7 +76,7 @@ DELETE FROM table_without_pk WHERE b = 1; DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data @@ -105,6 +105,20 @@ WARNING: table "table_with_unique" without primary key or replica identity is n } (3 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +WARNING: no tuple identifier for DELETE in table "public"."table_without_pk" +WARNING: no tuple identifier for DELETE in table "public"."table_with_unique" + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_pk","identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(7 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/delete2.out b/expected/delete2.out index 338b711b53e3..5cfc403a011e 100644 --- a/expected/delete2.out +++ b/expected/delete2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing @@ -124,6 +124,32 @@ WARNING: table "table_with_unique" without primary key or replica identity is n } (9 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +WARNING: no tuple identifier for DELETE in table "public"."table_with_pk" +WARNING: no tuple identifier for DELETE in table "public"."table_without_pk" +WARNING: no tuple identifier for DELETE in table "public"."table_with_unique" + data +---------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(18 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/delete3.out b/expected/delete3.out index 7c17a5f572d6..36aa886ce7bd 100644 --- a/expected/delete3.out +++ b/expected/delete3.out @@ -83,7 +83,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -168,6 +168,35 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (10 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_pk","identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_pk","identity":[{"name":"a","type":"smallint","value":2},{"name":"b","type":"smallint","value":4},{"name":"c","type":"integer","value":5},{"name":"d","type":"bigint","value":6},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_without_pk","identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_unique","identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(24 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/delete4.out b/expected/delete4.out index 5d0bbfe9f206..a4f4a7ddfac4 100644 --- a/expected/delete4.out +++ b/expected/delete4.out @@ -35,7 +35,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ----------------------------------------------------------------- { + @@ -76,6 +76,21 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (4 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_unique","identity":[{"name":"g","type":"double precision","value":1.23},{"name":"n","type":"boolean","value":false}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"table_with_unique","identity":[{"name":"g","type":"double precision","value":4.56},{"name":"n","type":"boolean","value":true}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(10 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/filtertable.out b/expected/filtertable.out index e08b67584247..2cefb887b5c7 100644 --- a/expected/filtertable.out +++ b/expected/filtertable.out @@ -72,7 +72,7 @@ INSERT INTO "filter""table_9" (a, b) VALUES(1, 'public.filter"table_9'); INSERT INTO " filter_table_10" (a, b) VALUES(1, 'public. filter_table_10'); INSERT INTO "*" (a, b) VALUES(1, 'public.*'); INSERT INTO "*".filter_table_0 (a, b) VALUES(1, '*.filter_table_0'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); data ------------------------------------------------------------------------------- { + @@ -169,6 +169,48 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pr } (17 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"filter_schema_1","table":"filter_table_2","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"filter_schema_1.filter_table_2"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"filter_table_2","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.filter_table_2"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"filter_table_4","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.filter_table_4"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(37 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/include_lsn.out b/expected/include_lsn.out index 102a58d7ea4e..7faf0063cdcd 100644 --- a/expected/include_lsn.out +++ b/expected/include_lsn.out @@ -11,7 +11,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one nextlsn INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); ?column? | ?column? ----------+---------- t | t @@ -20,7 +20,7 @@ SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg -- Two rows should have two records and two nextlsns INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); ?column? | ?column? ----------+---------- t | t @@ -28,7 +28,7 @@ SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg -- Two rows in one transaction should have one record and one nextlsn INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); ?column? | ?column? ----------+---------- t | t diff --git a/expected/include_timestamp.out b/expected/include_timestamp.out index 4243bbd2cb15..46f464d64373 100644 --- a/expected/include_timestamp.out +++ b/expected/include_timestamp.out @@ -12,7 +12,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one timestmap INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); ?column? | ?column? ----------+---------- t | t @@ -21,7 +21,7 @@ SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM -- Two rows should have two records and two timestamps INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); ?column? | ?column? ----------+---------- t | t @@ -29,7 +29,7 @@ SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM -- Two rows in one transaction should have one record and one timestamp INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); ?column? | ?column? ----------+---------- t | t diff --git a/expected/include_xids.out b/expected/include_xids.out index 3ce9096db3b1..241306ff5160 100644 --- a/expected/include_xids.out +++ b/expected/include_xids.out @@ -11,7 +11,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one xids INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); ?column? | ?column? ----------+---------- t | t @@ -20,7 +20,7 @@ SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_log -- Two rows should have two records and two xids INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); ?column? | ?column? ----------+---------- t | t @@ -28,7 +28,7 @@ SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_log -- Two rows in one transaction should have one record and one xid INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); ?column? | ?column? ----------+---------- f | t diff --git a/expected/insert1.out b/expected/insert1.out index be9e247d1b2a..fc3657f2b8d9 100644 --- a/expected/insert1.out +++ b/expected/insert1.out @@ -79,7 +79,7 @@ INSERT INTO table_without_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUE INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); INSERT INTO "test ""schema"."test "" with 'quotes'" VALUES (1, 2, 3); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -120,6 +120,17 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (1 row) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"table_with_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"I","schema":"public","table":"table_without_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"I","schema":"public","table":"table_with_unique","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"I","schema":"test \"schema","table":"test \" with 'quotes'","columns":[{"name":"id","type":"integer","value":1},{"name":"col spaces","type":"integer","value":2},{"name":"col\"quotes","type":"integer","value":3}]} + {"action":"C"} +(6 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/message.out b/expected/message.out index 6b36d4892786..e23643741517 100644 --- a/expected/message.out +++ b/expected/message.out @@ -89,7 +89,7 @@ SELECT 'msg13' FROM pg_logical_emit_message(true, 'added2', 'this message will b msg13 (1 row) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); data --------------------------------------------------------------------------------------------------------- { + @@ -198,6 +198,31 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (11 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); + data +----------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"M","transactional":true,"prefix":"wal2json","content":"this is a\\ message"} + {"action":"C"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"this is \"another\" message"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"Tapirus terrestris"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"Priodontes maximus"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"Caryocar brasiliense"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"this message will be printed even if the transaction is rollbacked"} + {"action":"M","transactional":false,"prefix":"wal2json","content":"this message will be printed before message #1"} + {"action":"B"} + {"action":"M","transactional":true,"prefix":"wal2json","content":"this is message #1"} + {"action":"M","transactional":true,"prefix":"wal2json","content":"this is message #2"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"M","transactional":true,"prefix":"added1","content":"this message will be printed"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(20 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/savepoint.out b/expected/savepoint.out index 241449a6af8d..6da5a9ba4d00 100644 --- a/expected/savepoint.out +++ b/expected/savepoint.out @@ -23,7 +23,7 @@ ROLLBACK TO SAVEPOINT sp2; RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------- { + diff --git a/expected/selecttable.out b/expected/selecttable.out index 03d47b507305..748239425d48 100644 --- a/expected/selecttable.out +++ b/expected/selecttable.out @@ -35,7 +35,7 @@ INSERT INTO select_schema_2.select_table_2 (a, b) VALUES(1, 'select_schema_2.sel INSERT INTO select_schema_2.select_table_3 (a, b) VALUES(1, 'select_schema_2.select_table_3'); INSERT INTO select_table_2 (a, b) VALUES(1, 'public.select_table_2'); INSERT INTO select_table_3 (a, b) VALUES(1, 'public.select_table_3'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); data ------------------------------------------------------------------------------- { + @@ -120,6 +120,33 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pr } (8 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.select_table_1"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"select_schema_1","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_1.select_table_1"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"select_schema_2","table":"select_table_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_1"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"select_schema_2","table":"select_table_2","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_2"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"select_schema_2","table":"select_table_3","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"select_schema_2.select_table_3"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"select_table_3","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"public.select_table_3"}]} + {"action":"C"} +(22 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/specialvalue.out b/expected/specialvalue.out index fefcb3975d2d..b035da70cd49 100644 --- a/expected/specialvalue.out +++ b/expected/specialvalue.out @@ -17,7 +17,7 @@ INSERT INTO xpto (b, c, d) VALUES('f', 'test2', 'nan'); INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/toast.out b/expected/toast.out index f21670c3458e..5ceab77246a0 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -30,7 +30,7 @@ INSERT INTO xpto (toasted_col2) SELECT repeat(string_agg(to_char(g.i, 'FM0000'), UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_series(1, 2000) g(i)) WHERE id = 1; UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -107,6 +107,26 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (5 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":0.840187716763467},{"name":"toasted_col2","type":"text","value":"24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000"},{"name":"rand2","type":"double precision","value":0.394382926635444}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":2},{"name":"toasted_col1","type":"text","value":null},{"name":"rand1","type":"double precision","value":0.783099223393947},{"name":"toasted_col2","type":"text","value":"0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500"},{"name":"rand2","type":"double precision","value":0.798440033104271}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":0.840187716763467},{"name":"rand2","type":"double precision","value":0.394382926635444}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456},{"name":"rand2","type":"double precision","value":0.394382926635444}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"xpto","identity":[{"name":"id","type":"integer","value":1}]} + {"action":"C"} +(15 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/typmod.out b/expected/typmod.out index c11969644174..59aa910ac863 100644 --- a/expected/typmod.out +++ b/expected/typmod.out @@ -32,7 +32,7 @@ INSERT INTO table_with_pk (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1 UPDATE table_with_pk SET f = -f WHERE b = 1; -- UPDATE: pk change DELETE FROM table_with_pk WHERE b = 1; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + @@ -80,7 +80,7 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pr } (3 rows) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + diff --git a/expected/update1.out b/expected/update1.out index 132eb968d6c8..a5acb255b2dd 100644 --- a/expected/update1.out +++ b/expected/update1.out @@ -79,7 +79,7 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing data @@ -128,6 +128,23 @@ WARNING: table "table_with_unique" without primary key or replica identity is n } (4 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +WARNING: no tuple identifier for UPDATE in table "public"."table_without_pk" +WARNING: no tuple identifier for UPDATE in table "public"."table_with_unique" + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":-1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(10 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/update2.out b/expected/update2.out index e30c337ac0c9..2bcf5fd6e265 100644 --- a/expected/update2.out +++ b/expected/update2.out @@ -80,7 +80,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); WARNING: table "table_with_pk" without primary key or replica identity is nothing WARNING: table "table_without_pk" without primary key or replica identity is nothing WARNING: table "table_with_unique" without primary key or replica identity is nothing @@ -124,6 +124,32 @@ WARNING: table "table_with_unique" without primary key or replica identity is n } (9 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +WARNING: no tuple identifier for UPDATE in table "public"."table_with_pk" +WARNING: no tuple identifier for UPDATE in table "public"."table_without_pk" +WARNING: no tuple identifier for UPDATE in table "public"."table_with_unique" + data +---------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(18 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/update3.out b/expected/update3.out index 4723b3fec3c3..463a4ac137ea 100644 --- a/expected/update3.out +++ b/expected/update3.out @@ -81,7 +81,7 @@ ALTER TABLE table_without_pk REPLICA IDENTITY DEFAULT; ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -161,6 +161,32 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (9 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_without_pk","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_unique","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(21 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/expected/update4.out b/expected/update4.out index ad140dc00383..c9a4353568d6 100644 --- a/expected/update4.out +++ b/expected/update4.out @@ -37,7 +37,7 @@ ALTER TABLE table_with_unique REPLICA IDENTITY USING INDEX table_with_unique_g_n UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -84,6 +84,21 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pre } (4 rows) +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_unique","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":-2},{"name":"d","type":"bigint","value":3},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":false},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"g","type":"double precision","value":1.23},{"name":"n","type":"boolean","value":false}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"table_with_unique","columns":[{"name":"a","type":"smallint","value":2},{"name":"b","type":"smallint","value":4},{"name":"c","type":"integer","value":5},{"name":"d","type":"bigint","value":6},{"name":"e","type":"numeric(5,3)","value":3.540},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":-4.56},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"g","type":"double precision","value":4.56},{"name":"n","type":"boolean","value":true}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(10 rows) + SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? ---------- diff --git a/sql/bytea.sql b/sql/bytea.sql index 94a5dd3deb3b..ac3cb3daab74 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -19,5 +19,6 @@ INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()) UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 4dd7c8d56faa..58722c63b2df 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -5,9 +5,9 @@ SET synchronous_commit = on; SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'nosuchopt', '42'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'nosuchopt', '42'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-unchanged-toast', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-unchanged-toast', '1'); -- don't include not-null constraint by default CREATE TABLE table_optional ( @@ -20,13 +20,13 @@ INSERT INTO table_optional (b, c) VALUES(NULL, TRUE); UPDATE table_optional SET b = 123 WHERE a = 1; DELETE FROM table_optional WHERE a = 1; DROP TABLE table_optional; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'include-not-null', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0', 'include-not-null', '1'); -- By default don't write in chunks CREATE TABLE x (); DROP TABLE x; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-xids', '0'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'write-in-chunks', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '0', 'write-in-chunks', '1'); -- By default don't write xids CREATE TABLE gimmexid (id integer PRIMARY KEY); diff --git a/sql/delete1.sql b/sql/delete1.sql index 1bc2c84ba969..ae1354370afc 100644 --- a/sql/delete1.sql +++ b/sql/delete1.sql @@ -82,5 +82,6 @@ DELETE FROM table_with_pk WHERE b = 1; -- DELETE: unique DELETE FROM table_with_unique WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete2.sql b/sql/delete2.sql index c8aa76f1e955..00235747602c 100644 --- a/sql/delete2.sql +++ b/sql/delete2.sql @@ -86,5 +86,6 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete3.sql b/sql/delete3.sql index f596b61e76c9..8c696e46ed65 100644 --- a/sql/delete3.sql +++ b/sql/delete3.sql @@ -89,5 +89,6 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; DELETE FROM table_with_unique WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/delete4.sql b/sql/delete4.sql index f4492b1e6cd6..20eebee3aef4 100644 --- a/sql/delete4.sql +++ b/sql/delete4.sql @@ -37,5 +37,6 @@ DELETE FROM table_with_unique WHERE b = 1; DELETE FROM table_with_unique WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/filtertable.sql b/sql/filtertable.sql index 9ed9d8dac093..9ebd9bf529d4 100644 --- a/sql/filtertable.sql +++ b/sql/filtertable.sql @@ -60,5 +60,6 @@ INSERT INTO " filter_table_10" (a, b) VALUES(1, 'public. filter_table_10'); INSERT INTO "*" (a, b) VALUES(1, 'public.*'); INSERT INTO "*".filter_table_0 (a, b) VALUES(1, '*.filter_table_0'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-tables', ' foo.bar,*.filter_table_1 ,filter_schema_2.* , public.filter_table_3 , public.Filter_table_5, public.filter\ table_6, public.filter\.table_7 , public.filter\,table_8 , public.filter"table_9, *.\ filter_table_10 , public.\* , \*.filter_table_0 '); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/include_lsn.sql b/sql/include_lsn.sql index de5f7b01c0a1..3a9bb8d62d41 100644 --- a/sql/include_lsn.sql +++ b/sql/include_lsn.sql @@ -10,16 +10,16 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one nextlsn INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); -- Two rows should have two records and two nextlsns INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'nextlsn')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); -- Two rows in one transaction should have one record and one nextlsn INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-lsn', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'nextlsn')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-lsn', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/include_timestamp.sql b/sql/include_timestamp.sql index 93667640f30c..14aa80db4a80 100644 --- a/sql/include_timestamp.sql +++ b/sql/include_timestamp.sql @@ -10,16 +10,16 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one timestmap INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); -- Two rows should have two records and two timestamps INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'timestamp')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); -- Two rows in one transaction should have one record and one timestamp INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-timestamp', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/include_xids.sql b/sql/include_xids.sql index 32305cf3ea9d..110b6346f766 100644 --- a/sql/include_xids.sql +++ b/sql/include_xids.sql @@ -10,16 +10,16 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js -- One row should have one record and one xids INSERT INTO tbl VALUES (1); -SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 1, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); -- Two rows should have two records and two xids INSERT INTO tbl VALUES (2); INSERT INTO tbl VALUES (3); -SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 2 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); -- Two rows in one transaction should have one record and one xid INSERT INTO tbl VALUES (4), (5); -SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '1'); +SELECT count(*) = 2, count(distinct ((data::json)->'xid')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-xids', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/insert1.sql b/sql/insert1.sql index c047c12b3f6b..fbb514a24af3 100644 --- a/sql/insert1.sql +++ b/sql/insert1.sql @@ -84,5 +84,6 @@ INSERT INTO table_with_unique (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALU INSERT INTO "test ""schema"."test "" with 'quotes'" VALUES (1, 2, 3); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/message.sql b/sql/message.sql index 3bfa3daeb5fc..b762a8ae101d 100644 --- a/sql/message.sql +++ b/sql/message.sql @@ -27,6 +27,7 @@ SELECT 'msg11' FROM pg_logical_emit_message(true, 'filtered', 'this message will SELECT 'msg12' FROM pg_logical_emit_message(true, 'added1', 'this message will be printed'); SELECT 'msg13' FROM pg_logical_emit_message(true, 'added2', 'this message will be filtered'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-msg-prefixes', 'foo, filtered, bar', 'add-msg-prefixes', 'added1, added3, wal2json'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/savepoint.sql b/sql/savepoint.sql index 9fd5a2a1ee3b..78789ea9951f 100644 --- a/sql/savepoint.sql +++ b/sql/savepoint.sql @@ -24,5 +24,5 @@ RELEASE SAVEPOINT sp1; INSERT INTO xpto (b) VALUES('francisco'); END; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/selecttable.sql b/sql/selecttable.sql index aac1aad68225..64fcd0e40c78 100644 --- a/sql/selecttable.sql +++ b/sql/selecttable.sql @@ -32,6 +32,7 @@ INSERT INTO select_schema_2.select_table_3 (a, b) VALUES(1, 'select_schema_2.sel INSERT INTO select_table_2 (a, b) VALUES(1, 'public.select_table_2'); INSERT INTO select_table_3 (a, b) VALUES(1, 'public.select_table_3'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'add-tables', ' foo.bar,*.select_table_1 ,select_schema_2.* , public.select_table_3 '); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/specialvalue.sql b/sql/specialvalue.sql index b23c249a73d1..3c65bd3058ce 100644 --- a/sql/specialvalue.sql +++ b/sql/specialvalue.sql @@ -17,5 +17,5 @@ INSERT INTO xpto (b, c, d) VALUES(NULL, 'null', '-inf'); INSERT INTO xpto (b, c, d) VALUES(TRUE, E'valid: '' " \\ / \b \f \n \r \t \u207F \u967F invalid: \\g \\k end', 123.456); COMMIT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/toast.sql b/sql/toast.sql index a3eb63a1425d..20caf4006a24 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -30,5 +30,6 @@ UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/typmod.sql b/sql/typmod.sql index 15ba8ceb26c4..dc4141eb7bde 100644 --- a/sql/typmod.sql +++ b/sql/typmod.sql @@ -35,6 +35,6 @@ UPDATE table_with_pk SET f = -f WHERE b = 1; -- UPDATE: pk change DELETE FROM table_with_pk WHERE b = 1; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'pretty-print', '1'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update1.sql b/sql/update1.sql index 4e7d20a71b30..062390e2ea1e 100644 --- a/sql/update1.sql +++ b/sql/update1.sql @@ -86,5 +86,6 @@ UPDATE table_with_pk SET b = -b WHERE b = 1; -- UPDATE: unique UPDATE table_with_unique SET n = false WHERE b = 1; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update2.sql b/sql/update2.sql index f1ce1ce0eb56..3d3a12279d2a 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -86,5 +86,6 @@ ALTER TABLE table_with_unique REPLICA IDENTITY NOTHING; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update3.sql b/sql/update3.sql index 402af7e2d503..d476c99d8903 100644 --- a/sql/update3.sql +++ b/sql/update3.sql @@ -87,5 +87,6 @@ ALTER TABLE table_with_unique REPLICA IDENTITY FULL; UPDATE table_with_unique SET f = -f WHERE b = 1; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/sql/update4.sql b/sql/update4.sql index ef812610471e..5d18ce80aef8 100644 --- a/sql/update4.sql +++ b/sql/update4.sql @@ -39,5 +39,6 @@ UPDATE table_with_unique SET c = -c WHERE b = 1; UPDATE table_with_unique SET g = -g WHERE n = true; ALTER TABLE table_with_unique REPLICA IDENTITY DEFAULT; -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 4e028113a580..a9be13ee6bbd 100644 --- a/wal2json.c +++ b/wal2json.c @@ -25,7 +25,7 @@ #include "utils/rel.h" #include "utils/syscache.h" -#define WAL2JSON_FORMAT_VERSION 1 +#define WAL2JSON_FORMAT_VERSION 2 #define WAL2JSON_FORMAT_MIN_VERSION 1 PG_MODULE_MAGIC; @@ -36,6 +36,7 @@ extern void PGDLLEXPORT _PG_output_plugin_init(OutputPluginCallbacks *cb); typedef struct { MemoryContext context; + bool include_transaction; /* BEGIN and COMMIT objects (v2) */ bool include_xids; /* include transaction ids */ bool include_timestamp; /* include transaction timestamp */ bool include_schemas; /* qualify tables */ @@ -69,6 +70,12 @@ typedef struct char sp[2]; /* space, if pretty print */ } JsonDecodingData; +typedef enum +{ + PGOUTPUTJSON_CHANGE, + PGOUTPUTJSON_IDENTITY +} PGOutputJsonKind; + typedef struct SelectTable { char *schemaname; @@ -98,6 +105,39 @@ static bool parse_table_identifier(List *qualified_tables, char separator, List static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); static bool split_string_to_list(char *rawstring, char separator, List **sl); +/* version 1 */ +static void pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn); +static void pg_decode_commit_txn_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr commit_lsn); +static void pg_decode_change_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, Relation rel, + ReorderBufferChange *change); +#if PG_VERSION_NUM >= 90600 +static void pg_decode_message_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr lsn, + bool transactional, const char *prefix, + Size content_size, const char *content); +#endif + +/* version 2 */ +static void pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn); +static void pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr commit_lsn); +static void pg_decode_write_value(LogicalDecodingContext *ctx, Datum value, bool isnull, Oid typid); +static void pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple tuple, PGOutputJsonKind kind); +static void pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); +static void pg_decode_change_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, Relation rel, + ReorderBufferChange *change); +#if PG_VERSION_NUM >= 90600 +static void pg_decode_message_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, XLogRecPtr lsn, + bool transactional, const char *prefix, + Size content_size, const char *content); +#endif + void _PG_init(void) { @@ -138,6 +178,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is ALLOCSET_DEFAULT_MAXSIZE #endif ); + data->include_transaction = true; data->include_xids = false; data->include_timestamp = false; data->include_schemas = true; @@ -177,7 +218,18 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is Assert(elem->arg == NULL || IsA(elem->arg, String)); - if (strcmp(elem->defname, "include-xids") == 0) + if (strcmp(elem->defname, "include-transaction") == 0) + { + /* if option value is NULL then assume that value is true */ + if (elem->arg == NULL) + data->include_transaction = true; + else if (!parse_bool(strVal(elem->arg), &data->include_transaction)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + else if (strcmp(elem->defname, "include-xids") == 0) { /* If option does not provide a value, it means its value is true */ if (elem->arg == NULL) @@ -474,6 +526,19 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { JsonDecodingData *data = ctx->output_plugin_private; + if (data->format_version == 2) + pg_decode_begin_txn_v2(ctx, txn); + else if (data->format_version == 1) + pg_decode_begin_txn_v1(ctx, txn); + else + elog(ERROR, "format version %d is not supported", data->format_version); +} + +static void +pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + data->nr_changes = 0; /* Transaction starts */ @@ -502,6 +567,33 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) OutputPluginWrite(ctx, true); } +static void +pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + /* don't include BEGIN object */ + if (!data->include_transaction) + return; + + OutputPluginPrepareWrite(ctx, true); + appendStringInfoString(ctx->out, "{\"action\":\"B\""); + if (data->include_xids) + appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->final_lsn)); + appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); + pfree(lsn_str); + } + + appendStringInfoChar(ctx->out, '}'); + OutputPluginWrite(ctx, true); +} + /* COMMIT callback */ static void pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -509,6 +601,20 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; + if (data->format_version == 2) + pg_decode_commit_txn_v2(ctx, txn, commit_lsn); + else if (data->format_version == 1) + pg_decode_commit_txn_v1(ctx, txn, commit_lsn); + else + elog(ERROR, "format version %d is not supported", data->format_version); +} + +static void +pg_decode_commit_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr commit_lsn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + if (txn->has_catalog_changes) elog(DEBUG2, "txn has catalog changes: yes"); else @@ -529,6 +635,34 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, OutputPluginWrite(ctx, true); } +static void +pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr commit_lsn) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + /* don't include COMMIT object */ + if (!data->include_transaction) + return; + + OutputPluginPrepareWrite(ctx, true); + appendStringInfoString(ctx->out, "{\"action\":\"C\""); + if (data->include_xids) + appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, commit_lsn)); + appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); + pfree(lsn_str); + } + + appendStringInfoChar(ctx->out, '}'); + OutputPluginWrite(ctx, true); +} + /* * Accumulate tuple information and stores it at the end @@ -831,6 +965,20 @@ identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + if (data->format_version == 2) + pg_decode_change_v2(ctx, txn, relation, change); + else if (data->format_version == 1) + pg_decode_change_v1(ctx, txn, relation, change); + else + elog(ERROR, "format version %d is not supported", data->format_version); +} + +static void +pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + Relation relation, ReorderBufferChange *change) { JsonDecodingData *data; Form_pg_class class_form; @@ -1088,6 +1236,448 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, OutputPluginWrite(ctx, true); } +static void +pg_decode_write_value(LogicalDecodingContext *ctx, Datum value, bool isnull, Oid typid) +{ + Oid typoutfunc; + bool isvarlena; + char *outstr; + + if (isnull) + { + appendStringInfoString(ctx->out, "null"); + return; + } + + /* get type information and call its output function */ + getTypeOutputInfo(typid, &typoutfunc, &isvarlena); + + /* XXX dead code? check is one level above. */ + if (isvarlena && VARATT_IS_EXTERNAL_ONDISK(value)) + { + elog(DEBUG1, "unchanged TOAST Datum"); + return; + } + + /* if value is varlena, detoast Datum */ + if (isvarlena) + { + Datum detoastedval; + + detoastedval = PointerGetDatum(PG_DETOAST_DATUM(value)); + outstr = OidOutputFunctionCall(typoutfunc, detoastedval); + } + else + { + outstr = OidOutputFunctionCall(typoutfunc, value); + } + + /* + * Data types are printed with quotes unless they are number, true, false, + * null, an array or an object. + * + * The NaN an Infinity are not valid JSON symbols. Hence, regardless of + * sign they are represented as the string null. + */ + switch (typid) + { + case INT2OID: + case INT4OID: + case INT8OID: + case OIDOID: + case FLOAT4OID: + case FLOAT8OID: + case NUMERICOID: + if (pg_strncasecmp(outstr, "NaN", 3) == 0 || + pg_strncasecmp(outstr, "Infinity", 8) == 0 || + pg_strncasecmp(outstr, "-Infinity", 9) == 0) + { + appendStringInfoString(ctx->out, "null"); + elog(DEBUG1, "special value: %s", outstr); + } + else if (strspn(outstr, "0123456789+-eE.") == strlen(outstr)) + appendStringInfo(ctx->out, "%s", outstr); + else + elog(ERROR, "%s is not a number", outstr); + break; + case BOOLOID: + if (strcmp(outstr, "t") == 0) + appendStringInfoString(ctx->out, "true"); + else + appendStringInfoString(ctx->out, "false"); + break; + case BYTEAOID: + /* string is "\x54617069727573", start after \x */ + escape_json(ctx->out, (outstr + 2)); + break; + default: + escape_json(ctx->out, outstr); + break; + } + + pfree(outstr); +} + +static void +pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple tuple, PGOutputJsonKind kind) +{ + JsonDecodingData *data; + TupleDesc tupdesc; + Relation idxrel; + TupleDesc idxdesc = NULL; + int i; + Datum *values; + bool *nulls; + bool need_sep = false; + + data = ctx->output_plugin_private; + + tupdesc = RelationGetDescr(relation); + values = (Datum *) palloc(tupdesc->natts * sizeof(Datum)); + nulls = (bool *) palloc(tupdesc->natts * sizeof(bool)); + + /* break down the tuple into fields */ + heap_deform_tuple(tuple, tupdesc, values, nulls); + + /* figure out replica identity columns */ + if (kind == PGOUTPUTJSON_IDENTITY) + { + if (OidIsValid(relation->rd_replidindex)) /* REPLICA IDENTITY INDEX */ + { + idxrel = RelationIdGetRelation(relation->rd_replidindex); + idxdesc = RelationGetDescr(idxrel); + } +#if PG_VERSION_NUM >= 100000 + else if (OidIsValid(relation->rd_pkindex)) /* REPLICA IDENTITY DEFAULT + PK (10+) */ + { + idxrel = RelationIdGetRelation(relation->rd_pkindex); + idxdesc = RelationGetDescr(idxrel); + } +#else + else if (relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT && OidIsValid(relation->rd_replidindex)) /* 9.4, 9.5 and 9.6 */ + { + idxrel = RelationIdGetRelation(relation->rd_replidindex); + idxdesc = RelationGetDescr(idxrel); + } +#endif + else if (relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + elog(ERROR, "table does not have primary key or replica identity"); + } + + for (i = 0; i < tupdesc->natts; i++) + { + Form_pg_attribute attr; + int j; + bool found = false; + char *type_str; + + attr = TupleDescAttr(tupdesc, i); + + /* skip dropped or system columns */ + if (attr->attisdropped || attr->attnum < 0) + continue; + + /* + * oldtuple contains NULL on those values that are not defined by + * REPLICA IDENTITY. In this case, print only non-null values. + */ + if (nulls[i] && kind == PGOUTPUTJSON_IDENTITY) + continue; + + /* don't send unchanged TOAST Datum */ + if (!nulls[i] && attr->attlen == -1 && VARATT_IS_EXTERNAL_ONDISK(values[i])) + continue; + + /* + * Is it replica identity column? Print only those columns or all + * columns if REPLICA IDENTITY FULL is set. + */ + if (kind == PGOUTPUTJSON_IDENTITY && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + { + for (j = 0; j < idxdesc->natts; j++) + { + Form_pg_attribute iattr; + + iattr = TupleDescAttr(idxdesc, j); + if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) + found = true; + } + + if (!found) + continue; + } + + if (need_sep) + appendStringInfoChar(ctx->out, ','); + need_sep = true; + + appendStringInfoChar(ctx->out, '{'); + appendStringInfoString(ctx->out, "\"name\":"); + escape_json(ctx->out, NameStr(attr->attname)); + + /* type name (with typmod, if available) */ + if (data->include_types) + { + type_str = format_type_with_typemod(attr->atttypid, attr->atttypmod); + appendStringInfoString(ctx->out, ",\"type\":"); + appendStringInfo(ctx->out, "\"%s\"", type_str); + pfree(type_str); + } + + appendStringInfoString(ctx->out, ",\"value\":"); + pg_decode_write_value(ctx, values[i], nulls[i], attr->atttypid); + + /* + * Print optional for columns. This information is redundant for + * replica identity (index) because all attributes are not null. + */ + if (kind == PGOUTPUTJSON_CHANGE && data->include_not_null) + { + if (attr->attnotnull) + appendStringInfoString(ctx->out, ",\"optional\":false"); + else + appendStringInfoString(ctx->out, ",\"optional\":true"); + } + + appendStringInfoChar(ctx->out, '}'); + } + + pfree(values); + pfree(nulls); +} + +static void +pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + /* make sure rd_pkindex and rd_replidindex are set */ + RelationGetIndexList(relation); + + /* sanity checks */ + switch (change->action) + { + case REORDER_BUFFER_CHANGE_INSERT: + if (change->data.tp.newtuple == NULL) + { + elog(WARNING, "no tuple data for INSERT in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + return; + } + break; + case REORDER_BUFFER_CHANGE_UPDATE: + if (change->data.tp.newtuple == NULL) + { + elog(WARNING, "no tuple data for UPDATE in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + return; + } + if (change->data.tp.oldtuple == NULL) + { + if (!OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + { + elog(WARNING, "no tuple identifier for UPDATE in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + return; + } + } + break; + case REORDER_BUFFER_CHANGE_DELETE: + if (change->data.tp.oldtuple == NULL) + { + if (!OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + { + elog(WARNING, "no tuple identifier for DELETE in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + return; + } + } + break; + default: + Assert(false); + } + + OutputPluginPrepareWrite(ctx, true); + + appendStringInfoChar(ctx->out, '{'); + + switch (change->action) + { + case REORDER_BUFFER_CHANGE_INSERT: + appendStringInfoString(ctx->out, "\"action\":\"I\""); + break; + case REORDER_BUFFER_CHANGE_UPDATE: + appendStringInfoString(ctx->out, "\"action\":\"U\""); + break; + case REORDER_BUFFER_CHANGE_DELETE: + appendStringInfoString(ctx->out, "\"action\":\"D\""); + break; + default: + Assert(false); + } + + if (data->include_xids) + appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); + pfree(lsn_str); + } + + if (data->include_schemas) + { + appendStringInfo(ctx->out, ",\"schema\":"); + escape_json(ctx->out, get_namespace_name(RelationGetNamespace(relation))); + } + + appendStringInfo(ctx->out, ",\"table\":"); + escape_json(ctx->out, RelationGetRelationName(relation)); + + /* print new tuple (INSERT, UPDATE) */ + if (change->data.tp.newtuple != NULL) + { + appendStringInfoString(ctx->out, ",\"columns\":["); + pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_CHANGE); + appendStringInfoChar(ctx->out, ']'); + } + + /* + * Print old tuple (UPDATE, DELETE) + * + * old tuple is available when: + * (1) primary key changes; + * (2) replica identity is index and one of the indexed columns changes; + * (3) replica identity is full. + * + * If old tuple is not available (because (a) primary key does not change + * or (b) replica identity is index and none of indexed columns does not + * change) identity is obtained from new tuple (because it doesn't change). + * + */ + if (change->data.tp.oldtuple != NULL) + { + appendStringInfoString(ctx->out, ",\"identity\":["); + pg_decode_write_tuple(ctx, relation, &change->data.tp.oldtuple->tuple, PGOUTPUTJSON_IDENTITY); + appendStringInfoChar(ctx->out, ']'); + } + else + { + /* + * Old tuple is not available, however, identity can be obtained from + * new tuple (because it doesn't change). + */ + if (change->action == REORDER_BUFFER_CHANGE_UPDATE) + { + elog(DEBUG2, "old tuple is null on UPDATE"); + + /* + * Before v10, there is not rd_pkindex then rely on REPLICA + * IDENTITY DEFAULT to obtain primary key. + */ +#if PG_VERSION_NUM >= 100000 + if (OidIsValid(relation->rd_pkindex) || OidIsValid(relation->rd_replidindex)) +#else + if (OidIsValid(relation->rd_replidindex)) +#endif + { + elog(DEBUG1, "REPLICA IDENTITY: obtain old tuple using new tuple"); + appendStringInfoString(ctx->out, ",\"identity\":["); + pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_IDENTITY); + appendStringInfoChar(ctx->out, ']'); + } + else + { + /* old tuple is not available and can't be obtained, report it */ + elog(WARNING, "no old tuple data for UPDATE in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + } + } + + /* old tuple is not available and can't be obtained, report it */ + if (change->action == REORDER_BUFFER_CHANGE_DELETE) + { + elog(WARNING, "no old tuple data for DELETE in table \"%s\".\"%s\"", get_namespace_name(RelationGetNamespace(relation)), RelationGetRelationName(relation)); + } + } + + appendStringInfoChar(ctx->out, '}'); + + OutputPluginWrite(ctx, true); +} + +static void +pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + Relation relation, ReorderBufferChange *change) +{ + JsonDecodingData *data = ctx->output_plugin_private; + MemoryContext old; + + char *schemaname; + char *tablename; + + /* avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + /* schema and table names are used for chosen tables */ + schemaname = get_namespace_name(RelationGetNamespace(relation)); + tablename = RelationGetRelationName(relation); + + /* Exclude tables, if available */ + if (list_length(data->filter_tables) > 0) + { + ListCell *lc; + + foreach(lc, data->filter_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was filtered out", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + return; + } + } + } + } + + /* Add tables */ + if (list_length(data->add_tables) > 0) + { + ListCell *lc; + bool skip = true; + + /* all tables in all schemas are added by default */ + foreach(lc, data->add_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was added", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + skip = false; + } + } + } + + /* table was not found */ + if (skip) + return; + } + + pg_decode_write_change(ctx, txn, relation, change); + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); +} + #if PG_VERSION_NUM >= 90600 /* Callback for generic logical decoding messages */ static void @@ -1095,14 +1685,7 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr lsn, bool transactional, const char *prefix, Size content_size, const char *content) { - JsonDecodingData *data; - MemoryContext old; - char *content_str; - - data = ctx->output_plugin_private; - - /* Avoid leaking memory by using and resetting our own context */ - old = MemoryContextSwitchTo(data->context); + JsonDecodingData *data = ctx->output_plugin_private; /* Filter message prefixes, if available */ if (list_length(data->filter_msg_prefixes) > 0) @@ -1142,6 +1725,28 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } } + if (data->format_version == 2) + pg_decode_message_v2(ctx, txn, lsn, transactional, prefix, content_size, content); + else if (data->format_version == 1) + pg_decode_message_v1(ctx, txn, lsn, transactional, prefix, content_size, content); + else + elog(ERROR, "format version %d is not supported", data->format_version); +} + +static void +pg_decode_message_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr lsn, bool transactional, const char *prefix, Size + content_size, const char *content) +{ + JsonDecodingData *data; + MemoryContext old; + char *content_str; + + data = ctx->output_plugin_private; + + /* Avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + /* * write immediately iif (i) write-in-chunks=1 or (ii) non-transactional * messages. @@ -1197,6 +1802,72 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->write_in_chunks || !transactional) OutputPluginWrite(ctx, true); } + +static void +pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, + XLogRecPtr lsn, bool transactional, const char *prefix, Size + content_size, const char *content) +{ + JsonDecodingData *data = ctx->output_plugin_private; + MemoryContext old; + char *content_str; + + /* Avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + OutputPluginPrepareWrite(ctx, true); + appendStringInfoChar(ctx->out, '{'); + appendStringInfoString(ctx->out, "\"action\":\"M\""); + + if (data->include_xids) + { + /* + * Non-transactional messages can have no xid, hence, assigns null in + * this case. Assigns null for xid in non-transactional messages + * because in some cases there isn't an assigned xid. + * This same logic is valid for timestamp and origin. + */ + if (transactional) + appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + else + appendStringInfoString(ctx->out, ",\"xid\":null"); + } + + if (data->include_timestamp) + { + if (transactional) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); + else + appendStringInfoString(ctx->out, ",\"timestamp\":null"); + } + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, lsn)); + appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); + pfree(lsn_str); + } + + if (transactional) + appendStringInfoString(ctx->out, ",\"transactional\":true"); + else + appendStringInfoString(ctx->out, ",\"transactional\":false"); + + appendStringInfoString(ctx->out, ",\"prefix\":"); + escape_json(ctx->out, prefix); + + appendStringInfoString(ctx->out, ",\"content\":"); + content_str = (char *) palloc0((content_size + 1) * sizeof(char)); + strncpy(content_str, content, content_size); + escape_json(ctx->out, content_str); + pfree(content_str); + + appendStringInfoChar(ctx->out, '}'); + OutputPluginWrite(ctx, true); + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); +} #endif static bool From a897305e33bd9840b4516aa54e7019441ee46b3f Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 16 Dec 2019 21:18:15 -0300 Subject: [PATCH 075/154] Fix tests Postgres 12 breaks random() predictability. Since we use the same tests for all versions, replace random() with a sequence. --- expected/bytea.out | 104 ++++++++++++++--------------- expected/toast.out | 163 ++++++++++++++++++++++----------------------- sql/bytea.sql | 7 +- sql/toast.sql | 7 +- 4 files changed, 138 insertions(+), 143 deletions(-) diff --git a/expected/bytea.out b/expected/bytea.out index 6f149b158606..7225d93cde38 100644 --- a/expected/bytea.out +++ b/expected/bytea.out @@ -3,15 +3,11 @@ SET synchronous_commit = on; SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; -SELECT setseed(0); - setseed ---------- - -(1 row) - +DROP SEQUENCE IF EXISTS xpto_rand_seq; +CREATE SEQUENCE xpto_rand_seq START 11 INCREMENT 997; CREATE TABLE xpto ( id serial primary key, -rand1 float8 DEFAULT random(), +rand1 float8 DEFAULT nextval('xpto_rand_seq'), bincol bytea ); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); @@ -20,65 +16,65 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js init (1 row) -INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); +INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * 0.08122019), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); - data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "rand1", "bincol"], + - "columntypes": ["int4", "float8", "bytea"], + - "columnvalues": [1, 0.230543947778642, "0420019803930402045901000170038901410282024303210187026304890472032803710073031500080127007204210082021000680057052701150272044603260158034002800265052201570416028404170217048401540192044105030038052102890047010603670493019400360011025500350133054505070479015003050212043102910380030300220250053405340415016404260370020503990096025605130484019301340524020604040564034803890509026105500237048604090546028901300572055500890533038802620377017104790188027401390115017003430257010505610064007803080474061405840428024004710232018501470369015500970465008005050105047600480609003403350113015505150474042506280416049500610088034000510046013403040540037804990034010506640136059300840667003605830049000306210400012201100265061905570244037603950309047000680364052002090684039806060517043600250520058006450610058106860521063406910469035101160587062900550461017604480163050002270235016600530455016104690369070202030396052200820343043206890330024606210319000202540441061501730500035803580227053001360464003103100521050504790261013904590474055202490561015307000521049801960407006702000673052700720086027904450459051602240602022402560148076800030647026001480343075307230603055200960542030406140749072806860162063304380238072507300702040104640131022106990398037606880403023701470558059401140493040306870595014601830411010001140298026907730754051706960682041402800330055105100217012700610091054603070244028000770362079304960226056106500416013407560536044401790480036707150340021102820632055408550294078101190358000506850678025701010760063400430396087006250186041907670083008803400269058507220118004600480410070006210398010705310522047805380328027608060433015405550479056405440214075900640091084801560443020807620268033008120319075506120034023907250583078002880207018505740103063307350677018903780298041002190365050501470528001403620364029107040249062205290882065907780671030006230006051508160599062305030389035206990781066101490032006206710184060706880558000100060301025806480848017903380662087306490312088101860157050308290676090601920396071008740551074509410235093705580946050105610954081308290606067010160956033208950604065407800797081802710623048601720823089509040689042806360621067205610155060400340733054308730540011805150537005108580406067304780152043702620432001907630610086606210477051010640063008006870641023902360678099507950499047409191031102809750832036205830238052010350509096610570201050208550841099302830838106103660444061906130688021105300399072610180234067509640122041702220723066307580668006606300634027300210388001010430680087210041057019605080554090407271100017703341007041810290856054503131087014109960717082810660212032601930235072502040147026411000016018701400539075710690118071900830461058205130344028710740667022500410510096208910422118300420621023907870833039010600772040800600917096208370818108503760904035809740228071300650123019002950165071400701080114900681126057103130716020607140583099811340646071408960277032507800663002111490429025406460496038108430801055103340875041402670947032208540020105710670753040308380662106603150323009206491123077206711039121409330436045700560030000606200373090310470648059701000244062011840056010803150915078701201239111902140615097910060009075009550965119801251025123201320358031210580124097703630227122909980127128911120449091206020573086304280794017201080501018208760152117007750281089007050417125910260163005106890535028406070215041405830007087501700623011410541063092612321175008500640716024112620149052808130871095607370556112507911263030410830514052501341112053310301288117211480987087807140865069608030933004110510834019302010273108411791027025709330438014812460143067403800281040509261334031307151099132302010417079409131239033009570894118411571101004108420881109111070407011012600248025705160636054409310145046912530876015011641083057705310571039408690099130906281281098206710687042603270359084304400184109707030712028212610196043102720004132704261193096010150259006614201148016712770308147607970993069312341330106106050289125202311008048505200798068609611077069108140009040502891046067003570987033105290779064605210077014312291336150107930433027505480670130410441202059102150653015809211485016813360245123504820610070308211150149914820137003200821392139500620651028603421211097001150719063807180940130608810316125810540112151007460604056314641443016314201381030314551467014212991533080600070299045609960416119000581149055813900455088210781530099810200693001415970583148501590425128804680300117606140011112714370019143302861035024015001096141204480890025213480363018407381404089107531400148706331565028503080405059115061032060410120852062408271145003010731023114708601482040011191200077013080293054005551061030304060041023006970354064413010217002202431249089008790415037709111509142103960703124708040156078315911489108304510364047107610778051409971489087616541113109816791363066508810551108912661480091410010171163205560990007513540891159107361352024012170402103200141417081909051371022002901347160809680507043103370055019512681075037011851643137912631273053611320270015813781510056706711526025015060688164517320984125216040202000002740545005604740062115008511268104504750774056010220143083611851546058617640441034902290181104901090148025613831780046213850260101714450743108208101610056500640285135406341325150214850716125902640691171006200925007316891037022401240617020505930195047016291664122708960653102714720720131910091365082406921031155401251302040800120081135000861799055003140068117805240672137810030465120703851377000414301005073609010158025017410862129914450990074418621004082713531093077100271415084112250057152607341077010500651470150500691026062608180039078810731809166604871370076412431352178601710814098309550842050318120166056214420913165715510980122511521052033817911885037806581041028004131538167311910860110610621036193401150059084306261900101411981412194309271032098202140243009105570099004109430768109912281189069209570427156701071507064500941626070509510283065319821501010319720457115109830675140010771242150211200205028602391452149409420424193005300533145711860630110119041597139005561598090006611585136618310564003212321658129307340771150310251015094905121973138104380479192419171684052709971578010603660100172912810771129206200581186606531833149819670523022514371565125603400024119717430469168516310347132700971359085802051733096119600957174511941588025510080168003104440078056206731536006119481884008510711560056106851118091420331218019208031428195117791312081614430415031717041438048817381890056801910455000702530310191903401398137709102095038418392030162020360713093518820381012905731846055008951433200913911051178219691247009519791506041017731853182910150620179814060325169608870226025618382135064319710548034403581457179902210693069020290511195621280336130203622135099600300979162618540214195813831114219016450781215900990580051604480944199500681169049207671018101105400965135318601334130306551367007800841027029520700206142520661874221920291977057903220200153701090269048606081047152016341596025607631238160920851904074721671992178902151838200016601677164416521476138822411804159315361917186820310266066113021922000615640422126109190257091316780173065112100390022909532073193003311459113617391439067110600700031706560460058713271780023213351061066003071995092212331386109818950300149521291266127917681603043805991044189712802119028116040457074822011803021901040822129507731134097817080043004104791963034519941776162909431219090313881828196209560770175412430036221920022266168422260008015211730791130221660150134722100635096201850279038418361235161903700259108823581228187017490099190916072127181409211989182410760781022823970574038013610408102523370596130803190046014919600421041106480393165601242165175820581373149114732308108008950972187311260969002315132348043701162280104114410165108915942150151620130363191612440489166005740121059920841613048007230062146501591203244801820272236206250390220616801850237603120993208118470555245113111815046805112398059211192026222616060271229206000432102005850617129704811251169302150452106701180768207322250133013022011460196801651980188507650598142105022225169703020313213613350906023801231395150418371614196403871735020924861453034400821143182220741311128514402087189203320048159720500354191616601706027919031832169108681133076502941525252305061477142808551561001601281089134314292548088007670307093023842382129017421481043120270820228611511699084319271998238818862513128707350781026707520912137021122359134303970529165613400331145500322094033904691529117001630075026910162025229108071309220921102054037023830184129311372322104424970087158115341443191703651477139207081953029218932120036821670496241718311313108614090790050417850539069104301690037414871549046304170431192323570800074410911517004113880753218617610262000615222115133426220853213504432659268311430402169815221907056619912331100212352014181319880412064120331816140315330886166915412427109201732362195623330090192423241246233313160058153418902072116101720588046320062600088026561918271813350727087202792286057913842464021806122073030925581670157021620243163009552155096421302332156026001595142207231511059106990089132615810371086121691771057223922391266927072195157415101595182103682562121013441924077301251758238615632491111421620396120506991995158215711380056321510987016720380909238608132437118126552812095010571348007018401477184814240228153625522414193809380287111925381875251602671209067204360425159200011247120811951081119921572151256322301155120012402596143127942315100818900398129901540094032526970364154805050806197921150808036104572017145416691314074413750682191225901936164611461869109321660884149605821040159209110865196224771376277915710606068819381068272704962756114212481231183302630929087019272088275901071352072716191942177902982865265522822436111121541087172428520105280526680607264808781869094627312136188606601131104304931240241112282878141500660219134827492525084409071735194326501648205225141370266722162259157901942040075721002709190101700223016926061464008610461532030724101316285802662233161522301912027813011449166309900681093825870877300003413000272522630157295224352791141325240827296328370237126826990506049613022760242815851043085802292044154611761618243411651965242208731205258408070617235522360115013921762981037804012652089009030909061602922510167011592744066727220864230221112042121414842926243310170664305903142923009404552038001808372446269717370268052523610563306109521735273616271385051008510415257320781914242314292943309614080151293815040610188315241456123511290090150716602474207716260310070212611954210217772816252212421781132005510086115305371508130603603028192422611421024603592562033718811086283608242729315215330844196704942639164730420729027912091286036623751830188905222194177224651301002827161665261630590381052927391214009627342763094715300071041831953143115502811167245506510364110025590891011011420172142411712914310706002791027911342340150412321882107421890205114626140204109205530488227230321145264109110494030610241647048024622831018023570194299726401339211409122584076419961543097231550926117910021486167300351285283027012207006430123242172702292459131304101565151101590954286422941876219330670609046707650507140219561520290303551556091032120988313832800731311417250962229630531377057212731540153608550545011930700328073302281101124616443077278112540115103021740031202920160013276818301754040908141502180013932788001629440313056730670068089804640298201017221958176711783226188422192067191709110744193203452591034107580051185725751456130425941058162131690780169107021249199427322988059111350797046330383037255015870570330301470919252804911685258223660887065502840105172319213303251202230608036622363365338228351101077533050752042324632354099923782505192715073003020206871965109813482254120530880760110421890986171925613243167525342663278833172554010202991593247713070541155432532062112900032757311311100659192823270311269634442520022517121636002734040721271427450593181728500896342518712216049134412014257310962019186807483141253426941998285019211977189721500206004921790137077614142907137532482275228031960653100401800610303727761717155811432473120601771670322230520082169114402251190014900919204022742346143701262086019424261769085334411952146929621206320209862360214822032540027918992065036200473519263419641462356304590191236519080318090121052766268729672665108208742077230005253072110026921713007829750043216133430091212124112072000324112536019612010864051721112989330712192379239223113263088010230184036721332899209622142286214107762040223429160850070229213283326131210868050500142999352033500595228621282927194030180320212733912472140818611059006703721843212526261132298433360423264129693570351934813588288333703304348620121785277203001159309724460905191701932783298702613161116624032128230817301808273607061115264905640935257634720640221432932669031823912974148718121740240100411935150130532200097905190912312628472657123518913372236008430221330534413723022719503318291822722001218800400096020924610137216102383215063912253741156006332869049318781029014305091879036700881596036503173563371132602096196917052138206819180854220703291094168009742329168025472969079730471086183531941601373135661691155701502011136201021508347620873229183903781368270126031701000504972684235421911448154229960712263910370121044109853716214625560052035701110154187836162259130916472641269005421438057505481940328229210315090706403336162633000542174937481536165120670266170424280378186104700169028417911829294706442377053812252931249406692012281415852659230832252116285711172020053127820228079906222676118024983152135127861073319618701723170424132959076610343636279538711337157723000687371112771814184418130711207526201339086238123858012512612752120705650719294422833152200530570271174519480245309435392563379033483853168512721745240333650447375402940345370004201617252916372187325606540537248226753618275704781626300635971232162834550642154611891925330736121346375934251643013531802068176517533719397110530398053135553094019123483578183013883214307330302704372205943904166639273545302437152996067838542196276216273964250216181015290421540583200823492950159501740329081232713383353729983984344506493913298836973625197403463475015131301077010416122708112804940835171625183203064000763380097208952624032504031588028138752243016128261906381507522257325209041343026810102968299821473468384138781929299104442007231714232910087617523318247720363133064722001889256919502648074611293561210014000478098703162642037500792442231930932891022913160213316121991978238705774031142412302127332938194094187104441104132925602515181235572835033839382917279821361894157023693220178614081291378038151873369210993113168302982806165121833255276435241674113611861093399315280892276501773045050217591258374635592678087031902342275827293451171102413754035119041766363104981124112616422320222814683861312800544042199505591612326401270991175510044205411637832743338112932987294716480687050610851189163922202845397702380097363933890151348011670715087002190843186919881855186418931423038310542727339340230139408802831231103519353468390116843710400110902865415703324043061412094267146330922001333306993909049410850696324102250468338300600754034111032703383507450112328504851210188003781546165709962765165724711581367315272286330820253381401109813609017400773673093304210470365742831220377232741709067108452091222925153096068741851256227935552795024825530499365422561487295024321566230733741991278227111957401321620904138428391756349207294290225414214147352037173366197239701573247632843846397618851925118242100949318826373680078122991478169236954338346228270687339507092118318242551469218018481072376543434379324039481878077707361713173339474370103003252276251920291584247311000014316601000728088033050590236010762451344104402397342237031942088200522685260817972222257028362552042109300152201734211260203321621361276830490236336409721319137744381763379134251030128543151083399024762893176005951279433110202216001130521185127906213362265034081951288923122931422036992912150730271870254543241720363738464215205311200315334209771342106909884416226322770533113804343965310433441779153930760985447200734034183426363864356717713209328338394339360326720791042037511786032814924080086426394520031212193342210327701891309627221967260600150066194036071849061323541154041914183845121518433056301521744560255330452646253033623875131809032086322440210245062220620261068840173892255000461672371304683102299116920361147101282549146126981013412606414398342219680700091306030135116112292211142419221637072444911684240836082156090619943861127034763992383703162077022444692723001432780067071941990674085607261911308221603848008328903719177906622698395115750049318128543548254020553868463322823702270922982334277830231890345838872622070723140120458123993030364441913699167734830598172719973471060845560848450145263146353325570761118406533805308841343014102301400636114400403051419537092556320506821346380924213357258330343221343928413052188016700897264828641555174512390981004322691123068334231165375429040153158313840840293904693277156830691579005617774439312736711363403215764247083633340730182533803015295640691690413030764614428746721232035728531704365544320011046244911800014228530706151521212293099629640854173100054256476729803552166823351846150718451741274822054614446510724264447815383970147416822023218532074159449442122319053011292326481410960494355927762845058342944704233622222085213918743165158715364715073530211561277203704790210600394175444205720455192505551558242341384353042247273810028722111177238543653064069710894612056518302775213646203149207318583190138914413768184833794329341709263600290513513462184116410788302740420277120847461374094204093216373525582954199346464826028711291359407929904760351515070770221444312130077013563782156344032918184406852760322716333173152404510806449824570536440927471673083019034683066704871247144227150748358634922113243301041581040619592272318302383917140617724373221813241872275907834638444416191573417622912064044737444797120023653323332748153429492002300406221134330646"]+ - } + - ] + + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "bincol"], + + "columntypes": ["int4", "float8", "bytea"], + + "columnvalues": [1, 11, "0041004100410041004100410041004100410041004100420042004200420042004200420042004200420042004200420043004300430043004300430043004300430043004300430044004400440044004400440044004400440044004400440045004500450045004500450045004500450045004500450045004600460046004600460046004600460046004600460046004700470047004700470047004700470047004700470047004800480048004800480048004800480048004800480048004800490049004900490049004900490049004900490049004900500050005000500050005000500050005000500050005000510051005100510051005100510051005100510051005100510052005200520052005200520052005200520052005200520053005300530053005300530053005300530053005300530054005400540054005400540054005400540054005400540054005500550055005500550055005500550055005500550055005600560056005600560056005600560056005600560056005700570057005700570057005700570057005700570057005800580058005800580058005800580058005800580058005800590059005900590059005900590059005900590059005900600060006000600060006000600060006000600060006000610061006100610061006100610061006100610061006100610062006200620062006200620062006200620062006200620063006300630063006300630063006300630063006300630064006400640064006400640064006400640064006400640064006500650065006500650065006500650065006500650065006600660066006600660066006600660066006600660066006700670067006700670067006700670067006700670067006700680068006800680068006800680068006800680068006800690069006900690069006900690069006900690069006900700070007000700070007000700070007000700070007000700071007100710071007100710071007100710071007100710072007200720072007200720072007200720072007200720073007300730073007300730073007300730073007300730074007400740074007400740074007400740074007400740074007500750075007500750075007500750075007500750075007600760076007600760076007600760076007600760076007700770077007700770077007700770077007700770077007700780078007800780078007800780078007800780078007800790079007900790079007900790079007900790079007900800080008000800080008000800080008000800080008000800081008100810081008100810081008100810081008100810082008200820082008200820082008200820082008200820083008300830083008300830083008300830083008300830083008400840084008400840084008400840084008400840084008500850085008500850085008500850085008500850085008600860086008600860086008600860086008600860086008600870087008700870087008700870087008700870087008700880088008800880088008800880088008800880088008800890089008900890089008900890089008900890089008900900090009000900090009000900090009000900090009000900091009100910091009100910091009100910091009100910092009200920092009200920092009200920092009200920093009300930093009300930093009300930093009300930093009400940094009400940094009400940094009400940094009500950095009500950095009500950095009500950095009600960096009600960096009600960096009600960096009600970097009700970097009700970097009700970097009700980098009800980098009800980098009800980098009800990099009900990099009900990099009900990099009900990100010001000100010001000100010001000100010001000101010101010101010101010101010101010101010101010102010201020102010201020102010201020102010201020102010301030103010301030103010301030103010301030103010401040104010401040104010401040104010401040104010501050105010501050105010501050105010501050105010601060106010601060106010601060106010601060106010601070107010701070107010701070107010701070107010701080108010801080108010801080108010801080108010801090109010901090109010901090109010901090109010901090110011001100110011001100110011001100110011001100111011101110111011101110111011101110111011101110112011201120112011201120112011201120112011201120112011301130113011301130113011301130113011301130113011401140114011401140114011401140114011401140114011501150115011501150115011501150115011501150115011501160116011601160116011601160116011601160116011601170117011701170117011701170117011701170117011701180118011801180118011801180118011801180118011801190119011901190119011901190119011901190119011901190120012001200120012001200120012001200120012001200121012101210121012101210121012101210121012101210122012201220122012201220122012201220122012201220122012301230123012301230123012301230123012301230123012401240124012401240124012401240124012401240124012501250125012501250125012501250125012501250125012501260126012601260126012601260126012601260126012601270127012701270127012701270127012701270127012701280128012801280128012801280128012801280128012801280129012901290129012901290129012901290129012901290130013001300130013001300130013001300130013001300131013101310131013101310131013101310131013101310131013201320132013201320132013201320132013201320132013301330133013301330133013301330133013301330133013401340134013401340134013401340134013401340134013501350135013501350135013501350135013501350135013501360136013601360136013601360136013601360136013601370137013701370137013701370137013701370137013701380138013801380138013801380138013801380138013801380139013901390139013901390139013901390139013901390140014001400140014001400140014001400140014001400141014101410141014101410141014101410141014101410141014201420142014201420142014201420142014201420142014301430143014301430143014301430143014301430143014401440144014401440144014401440144014401440144014401450145014501450145014501450145014501450145014501460146014601460146014601460146014601460146014601470147014701470147014701470147014701470147014701470148014801480148014801480148014801480148014801480149014901490149014901490149014901490149014901490150015001500150015001500150015001500150015001500151015101510151015101510151015101510151015101510151015201520152015201520152015201520152015201520152015301530153015301530153015301530153015301530153015401540154015401540154015401540154015401540154015401550155015501550155015501550155015501550155015501560156015601560156015601560156015601560156015601570157015701570157015701570157015701570157015701570158015801580158015801580158015801580158015801580159015901590159015901590159015901590159015901590160016001600160016001600160016001600160016001600160016101610161016101610161016101610161016101610161016201620162016201620162016201620162016201620162016301630163016301630163016301630163016301630163016301640164016401640164016401640164016401640164016401650165016501650165016501650165016501650165016501660166016601660166016601660166016601660166016601670167016701670167016701670167016701670167016701670168016801680168016801680168016801680168016801680169016901690169016901690169016901690169016901690170017001700170017001700170017001700170017001700170017101710171017101710171017101710171017101710171017201720172017201720172017201720172017201720172017301730173017301730173017301730173017301730173017301740174017401740174017401740174017401740174017401750175017501750175017501750175017501750175017501760176017601760176017601760176017601760176017601760177017701770177017701770177017701770177017701770178017801780178017801780178017801780178017801780179017901790179017901790179017901790179017901790179018001800180018001800180018001800180018001800180018101810181018101810181018101810181018101810181018201820182018201820182018201820182018201820182018301830183018301830183018301830183018301830183018301840184018401840184018401840184018401840184018401850185018501850185018501850185018501850185018501860186018601860186018601860186018601860186018601860187018701870187018701870187018701870187018701870188018801880188018801880188018801880188018801880189018901890189018901890189018901890189018901890189019001900190019001900190019001900190019001900190019101910191019101910191019101910191019101910191019201920192019201920192019201920192019201920192019201930193019301930193019301930193019301930193019301940194019401940194019401940194019401940194019401950195019501950195019501950195019501950195019501950196019601960196019601960196019601960196019601960197019701970197019701970197019701970197019701970198019801980198019801980198019801980198019801980199019901990199019901990199019901990199019901990199020002000200020002000200020002000200020002000200020102010201020102010201020102010201020102010201020202020202020202020202020202020202020202020202020202030203020302030203020302030203020302030203020302040204020402040204020402040204020402040204020402050205020502050205020502050205020502050205020502050206020602060206020602060206020602060206020602060207020702070207020702070207020702070207020702070208020802080208020802080208020802080208020802080208020902090209020902090209020902090209020902090209021002100210021002100210021002100210021002100210021102110211021102110211021102110211021102110211021102120212021202120212021202120212021202120212021202130213021302130213021302130213021302130213021302140214021402140214021402140214021402140214021402150215021502150215021502150215021502150215021502150216021602160216021602160216021602160216021602160217021702170217021702170217021702170217021702170218021802180218021802180218021802180218021802180218021902190219021902190219021902190219021902190219022002200220022002200220022002200220022002200220022102210221022102210221022102210221022102210221022102220222022202220222022202220222022202220222022202230223022302230223022302230223022302230223022302240224022402240224022402240224022402240224022402240225022502250225022502250225022502250225022502250226022602260226022602260226022602260226022602260227022702270227022702270227022702270227022702270227022802280228022802280228022802280228022802280228022902290229022902290229022902290229022902290229023002300230023002300230023002300230023002300230023102310231023102310231023102310231023102310231023102320232023202320232023202320232023202320232023202330233023302330233023302330233023302330233023302340234023402340234023402340234023402340234023402340235023502350235023502350235023502350235023502350236023602360236023602360236023602360236023602360237023702370237023702370237023702370237023702370237023802380238023802380238023802380238023802380238023902390239023902390239023902390239023902390239024002400240024002400240024002400240024002400240024002410241024102410241024102410241024102410241024102420242024202420242024202420242024202420242024202430243024302430243024302430243024302430243024302430244024402440244024402440244024402440244024402440245024502450245024502450245024502450245024502450246024602460246024602460246024602460246024602460247024702470247024702470247024702470247024702470247024802480248024802480248024802480248024802480248024902490249024902490249024902490249024902490249025002500250025002500250025002500250025002500250025002510251025102510251025102510251025102510251025102520252025202520252025202520252025202520252025202530253025302530253025302530253025302530253025302530254025402540254025402540254025402540254025402540255025502550255025502550255025502550255025502550256025602560256025602560256025602560256025602560256025702570257025702570257025702570257025702570257025802580258025802580258025802580258025802580258025902590259025902590259025902590259025902590259025902600260026002600260026002600260026002600260026002610261026102610261026102610261026102610261026102620262026202620262026202620262026202620262026202630263026302630263026302630263026302630263026302630264026402640264026402640264026402640264026402640265026502650265026502650265026502650265026502650266026602660266026602660266026602660266026602660266026702670267026702670267026702670267026702670267026802680268026802680268026802680268026802680268026902690269026902690269026902690269026902690269026902700270027002700270027002700270027002700270027002710271027102710271027102710271027102710271027102720272027202720272027202720272027202720272027202720273027302730273027302730273027302730273027302730274027402740274027402740274027402740274027402740275027502750275027502750275027502750275027502750275027602760276027602760276027602760276027602760276027702770277027702770277027702770277027702770277027802780278027802780278027802780278027802780278027902790279027902790279027902790279027902790279027902800280028002800280028002800280028002800280028002810281028102810281028102810281028102810281028102820282028202820282028202820282028202820282028202820283028302830283028302830283028302830283028302830284028402840284028402840284028402840284028402840285028502850285028502850285028502850285028502850285028602860286028602860286028602860286028602860286028702870287028702870287028702870287028702870287028802880288028802880288028802880288028802880288028802890289028902890289028902890289028902890289028902900290029002900290029002900290029002900290029002910291029102910291029102910291029102910291029102910292029202920292029202920292029202920292029202920293029302930293029302930293029302930293029302930294029402940294029402940294029402940294029402940295029502950295029502950295029502950295029502950295029602960296029602960296029602960296029602960296029702970297029702970297029702970297029702970297029802980298029802980298029802980298029802980298029802990299029902990299029902990299029902990299029903000300030003000300030003000300030003000300030003010301030103010301030103010301030103010301030103010302030203020302030203020302030203020302030203020303030303030303030303030303030303030303030303030304030403040304030403040304030403040304030403040304030503050305030503050305030503050305030503050305030603060306030603060306030603060306030603060306030703070307030703070307030703070307030703070307030703080308030803080308030803080308030803080308030803090309030903090309030903090309030903090309030903100310031003100310031003100310031003100310031003110311031103110311031103110311031103110311031103110312031203120312031203120312031203120312031203120313031303130313031303130313031303130313031303130314031403140314031403140314031403140314031403140314031503150315031503150315031503150315031503150315031603160316031603160316031603160316031603160316031703170317031703170317031703170317031703170317031703180318031803180318031803180318031803180318031803190319031903190319031903190319031903190319031903200320032003200320032003200320032003200320032003200321032103210321032103210321032103210321032103210322032203220322032203220322032203220322032203220323032303230323032303230323032303230323032303230324032403240324032403240324032403240324032403240324032503250325032503250325032503250325032503250325032603260326032603260326032603260326032603260326032703270327032703270327032703270327032703270327032703280328032803280328032803280328032803280328032803290329032903290329032903290329032903290329032903300330033003300330033003300330033003300330033003300331033103310331033103310331033103310331033103310332033203320332033203320332033203320332033203320333033303330333033303330333033303330333033303330333033403340334033403340334033403340334033403340334033503350335033503350335033503350335033503350335033603360336033603360336033603360336033603360336033603370337033703370337033703370337033703370337033703380338033803380338033803380338033803380338033803390339033903390339033903390339033903390339033903400340034003400340034003400340034003400340034003400341034103410341034103410341034103410341034103410342034203420342034203420342034203420342034203420343034303430343034303430343034303430343034303430343034403440344034403440344034403440344034403440344034503450345034503450345034503450345034503450345034603460346034603460346034603460346034603460346034603470347034703470347034703470347034703470347034703480348034803480348034803480348034803480348034803490349034903490349034903490349034903490349034903490350035003500350035003500350035003500350035003500351035103510351035103510351035103510351035103510352035203520352035203520352035203520352035203520352035303530353035303530353035303530353035303530353035403540354035403540354035403540354035403540354035503550355035503550355035503550355035503550355035603560356035603560356035603560356035603560356035603570357035703570357035703570357035703570357035703580358035803580358035803580358035803580358035803590359035903590359035903590359035903590359035903590360036003600360036003600360036003600360036003600361036103610361036103610361036103610361036103610362036203620362036203620362036203620362036203620362036303630363036303630363036303630363036303630363036403640364036403640364036403640364036403640364036503650365036503650365036503650365036503650365036503660366036603660366036603660366036603660366036603670367036703670367036703670367036703670367036703680368036803680368036803680368036803680368036803680369036903690369036903690369036903690369036903690370037003700370037003700370037003700370037003700371037103710371037103710371037103710371037103710372037203720372037203720372037203720372037203720372037303730373037303730373037303730373037303730373037403740374037403740374037403740374037403740374037503750375037503750375037503750375037503750375037503760376037603760376037603760376037603760376037603770377037703770377037703770377037703770377037703780378037803780378037803780378037803780378037803780379037903790379037903790379037903790379037903790380038003800380038003800380038003800380038003800381038103810381038103810381038103810381038103810381038203820382038203820382038203820382038203820382038303830383038303830383038303830383038303830383038403840384038403840384038403840384038403840384038403850385038503850385038503850385038503850385038503860386038603860386038603860386038603860386038603870387038703870387038703870387038703870387038703880388038803880388038803880388038803880388038803880389038903890389038903890389038903890389038903890390039003900390039003900390039003900390039003900391039103910391039103910391039103910391039103910391039203920392039203920392039203920392039203920392039303930393039303930393039303930393039303930393039403940394039403940394039403940394039403940394039403950395039503950395039503950395039503950395039503960396039603960396039603960396039603960396039603970397039703970397039703970397039703970397039703970398039803980398039803980398039803980398039803980399039903990399039903990399039903990399039903990400040004000400040004000400040004000400040004000400040104010401040104010401040104010401040104010401040204020402040204020402040204020402040204020402040304030403040304030403040304030403040304030403040404040404040404040404040404040404040404040404040404050405040504050405040504050405040504050405040504060406040604060406040604060406"] + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "rand1"], + - "columntypes": ["int4", "float8"], + - "columnvalues": [1, 123.456], + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "bincol"], + + "columntypes": ["int4", "float8", "bytea"], + + "columnvalues": [1, 123.456, "0041004100410041004100410041004100410041004100420042004200420042004200420042004200420042004200420043004300430043004300430043004300430043004300430044004400440044004400440044004400440044004400440045004500450045004500450045004500450045004500450045004600460046004600460046004600460046004600460046004700470047004700470047004700470047004700470047004800480048004800480048004800480048004800480048004800490049004900490049004900490049004900490049004900500050005000500050005000500050005000500050005000510051005100510051005100510051005100510051005100510052005200520052005200520052005200520052005200520053005300530053005300530053005300530053005300530054005400540054005400540054005400540054005400540054005500550055005500550055005500550055005500550055005600560056005600560056005600560056005600560056005700570057005700570057005700570057005700570057005800580058005800580058005800580058005800580058005800590059005900590059005900590059005900590059005900600060006000600060006000600060006000600060006000610061006100610061006100610061006100610061006100610062006200620062006200620062006200620062006200620063006300630063006300630063006300630063006300630064006400640064006400640064006400640064006400640064006500650065006500650065006500650065006500650065006600660066006600660066006600660066006600660066006700670067006700670067006700670067006700670067006700680068006800680068006800680068006800680068006800690069006900690069006900690069006900690069006900700070007000700070007000700070007000700070007000700071007100710071007100710071007100710071007100710072007200720072007200720072007200720072007200720073007300730073007300730073007300730073007300730074007400740074007400740074007400740074007400740074007500750075007500750075007500750075007500750075007600760076007600760076007600760076007600760076007700770077007700770077007700770077007700770077007700780078007800780078007800780078007800780078007800790079007900790079007900790079007900790079007900800080008000800080008000800080008000800080008000800081008100810081008100810081008100810081008100810082008200820082008200820082008200820082008200820083008300830083008300830083008300830083008300830083008400840084008400840084008400840084008400840084008500850085008500850085008500850085008500850085008600860086008600860086008600860086008600860086008600870087008700870087008700870087008700870087008700880088008800880088008800880088008800880088008800890089008900890089008900890089008900890089008900900090009000900090009000900090009000900090009000900091009100910091009100910091009100910091009100910092009200920092009200920092009200920092009200920093009300930093009300930093009300930093009300930093009400940094009400940094009400940094009400940094009500950095009500950095009500950095009500950095009600960096009600960096009600960096009600960096009600970097009700970097009700970097009700970097009700980098009800980098009800980098009800980098009800990099009900990099009900990099009900990099009900990100010001000100010001000100010001000100010001000101010101010101010101010101010101010101010101010102010201020102010201020102010201020102010201020102010301030103010301030103010301030103010301030103010401040104010401040104010401040104010401040104010501050105010501050105010501050105010501050105010601060106010601060106010601060106010601060106010601070107010701070107010701070107010701070107010701080108010801080108010801080108010801080108010801090109010901090109010901090109010901090109010901090110011001100110011001100110011001100110011001100111011101110111011101110111011101110111011101110112011201120112011201120112011201120112011201120112011301130113011301130113011301130113011301130113011401140114011401140114011401140114011401140114011501150115011501150115011501150115011501150115011501160116011601160116011601160116011601160116011601170117011701170117011701170117011701170117011701180118011801180118011801180118011801180118011801190119011901190119011901190119011901190119011901190120012001200120012001200120012001200120012001200121012101210121012101210121012101210121012101210122012201220122012201220122012201220122012201220122012301230123012301230123012301230123012301230123012401240124012401240124012401240124012401240124012501250125012501250125012501250125012501250125012501260126012601260126012601260126012601260126012601270127012701270127012701270127012701270127012701280128012801280128012801280128012801280128012801280129012901290129012901290129012901290129012901290130013001300130013001300130013001300130013001300131013101310131013101310131013101310131013101310131013201320132013201320132013201320132013201320132013301330133013301330133013301330133013301330133013401340134013401340134013401340134013401340134013501350135013501350135013501350135013501350135013501360136013601360136013601360136013601360136013601370137013701370137013701370137013701370137013701380138013801380138013801380138013801380138013801380139013901390139013901390139013901390139013901390140014001400140014001400140014001400140014001400141014101410141014101410141014101410141014101410141014201420142014201420142014201420142014201420142014301430143014301430143014301430143014301430143014401440144014401440144014401440144014401440144014401450145014501450145014501450145014501450145014501460146014601460146014601460146014601460146014601470147014701470147014701470147014701470147014701470148014801480148014801480148014801480148014801480149014901490149014901490149014901490149014901490150015001500150015001500150015001500150015001500151015101510151015101510151015101510151015101510151015201520152015201520152015201520152015201520152015301530153015301530153015301530153015301530153015401540154015401540154015401540154015401540154015401550155015501550155015501550155015501550155015501560156015601560156015601560156015601560156015601570157015701570157015701570157015701570157015701570158015801580158015801580158015801580158015801580159015901590159015901590159015901590159015901590160016001600160016001600160016001600160016001600160016101610161016101610161016101610161016101610161016201620162016201620162016201620162016201620162016301630163016301630163016301630163016301630163016301640164016401640164016401640164016401640164016401650165016501650165016501650165016501650165016501660166016601660166016601660166016601660166016601670167016701670167016701670167016701670167016701670168016801680168016801680168016801680168016801680169016901690169016901690169016901690169016901690170017001700170017001700170017001700170017001700170017101710171017101710171017101710171017101710171017201720172017201720172017201720172017201720172017301730173017301730173017301730173017301730173017301740174017401740174017401740174017401740174017401750175017501750175017501750175017501750175017501760176017601760176017601760176017601760176017601760177017701770177017701770177017701770177017701770178017801780178017801780178017801780178017801780179017901790179017901790179017901790179017901790179018001800180018001800180018001800180018001800180018101810181018101810181018101810181018101810181018201820182018201820182018201820182018201820182018301830183018301830183018301830183018301830183018301840184018401840184018401840184018401840184018401850185018501850185018501850185018501850185018501860186018601860186018601860186018601860186018601860187018701870187018701870187018701870187018701870188018801880188018801880188018801880188018801880189018901890189018901890189018901890189018901890189019001900190019001900190019001900190019001900190019101910191019101910191019101910191019101910191019201920192019201920192019201920192019201920192019201930193019301930193019301930193019301930193019301940194019401940194019401940194019401940194019401950195019501950195019501950195019501950195019501950196019601960196019601960196019601960196019601960197019701970197019701970197019701970197019701970198019801980198019801980198019801980198019801980199019901990199019901990199019901990199019901990199020002000200020002000200020002000200020002000200020102010201020102010201020102010201020102010201020202020202020202020202020202020202020202020202020202030203020302030203020302030203020302030203020302040204020402040204020402040204020402040204020402050205020502050205020502050205020502050205020502050206020602060206020602060206020602060206020602060207020702070207020702070207020702070207020702070208020802080208020802080208020802080208020802080208020902090209020902090209020902090209020902090209021002100210021002100210021002100210021002100210021102110211021102110211021102110211021102110211021102120212021202120212021202120212021202120212021202130213021302130213021302130213021302130213021302140214021402140214021402140214021402140214021402150215021502150215021502150215021502150215021502150216021602160216021602160216021602160216021602160217021702170217021702170217021702170217021702170218021802180218021802180218021802180218021802180218021902190219021902190219021902190219021902190219022002200220022002200220022002200220022002200220022102210221022102210221022102210221022102210221022102220222022202220222022202220222022202220222022202230223022302230223022302230223022302230223022302240224022402240224022402240224022402240224022402240225022502250225022502250225022502250225022502250226022602260226022602260226022602260226022602260227022702270227022702270227022702270227022702270227022802280228022802280228022802280228022802280228022902290229022902290229022902290229022902290229023002300230023002300230023002300230023002300230023102310231023102310231023102310231023102310231023102320232023202320232023202320232023202320232023202330233023302330233023302330233023302330233023302340234023402340234023402340234023402340234023402340235023502350235023502350235023502350235023502350236023602360236023602360236023602360236023602360237023702370237023702370237023702370237023702370237023802380238023802380238023802380238023802380238023902390239023902390239023902390239023902390239024002400240024002400240024002400240024002400240024002410241024102410241024102410241024102410241024102420242024202420242024202420242024202420242024202430243024302430243024302430243024302430243024302430244024402440244024402440244024402440244024402440245024502450245024502450245024502450245024502450246024602460246024602460246024602460246024602460247024702470247024702470247024702470247024702470247024802480248024802480248024802480248024802480248024902490249024902490249024902490249024902490249025002500250025002500250025002500250025002500250025002510251025102510251025102510251025102510251025102520252025202520252025202520252025202520252025202530253025302530253025302530253025302530253025302530254025402540254025402540254025402540254025402540255025502550255025502550255025502550255025502550256025602560256025602560256025602560256025602560256025702570257025702570257025702570257025702570257025802580258025802580258025802580258025802580258025902590259025902590259025902590259025902590259025902600260026002600260026002600260026002600260026002610261026102610261026102610261026102610261026102620262026202620262026202620262026202620262026202630263026302630263026302630263026302630263026302630264026402640264026402640264026402640264026402640265026502650265026502650265026502650265026502650266026602660266026602660266026602660266026602660266026702670267026702670267026702670267026702670267026802680268026802680268026802680268026802680268026902690269026902690269026902690269026902690269026902700270027002700270027002700270027002700270027002710271027102710271027102710271027102710271027102720272027202720272027202720272027202720272027202720273027302730273027302730273027302730273027302730274027402740274027402740274027402740274027402740275027502750275027502750275027502750275027502750275027602760276027602760276027602760276027602760276027702770277027702770277027702770277027702770277027802780278027802780278027802780278027802780278027902790279027902790279027902790279027902790279027902800280028002800280028002800280028002800280028002810281028102810281028102810281028102810281028102820282028202820282028202820282028202820282028202820283028302830283028302830283028302830283028302830284028402840284028402840284028402840284028402840285028502850285028502850285028502850285028502850285028602860286028602860286028602860286028602860286028702870287028702870287028702870287028702870287028802880288028802880288028802880288028802880288028802890289028902890289028902890289028902890289028902900290029002900290029002900290029002900290029002910291029102910291029102910291029102910291029102910292029202920292029202920292029202920292029202920293029302930293029302930293029302930293029302930294029402940294029402940294029402940294029402940295029502950295029502950295029502950295029502950295029602960296029602960296029602960296029602960296029702970297029702970297029702970297029702970297029802980298029802980298029802980298029802980298029802990299029902990299029902990299029902990299029903000300030003000300030003000300030003000300030003010301030103010301030103010301030103010301030103010302030203020302030203020302030203020302030203020303030303030303030303030303030303030303030303030304030403040304030403040304030403040304030403040304030503050305030503050305030503050305030503050305030603060306030603060306030603060306030603060306030703070307030703070307030703070307030703070307030703080308030803080308030803080308030803080308030803090309030903090309030903090309030903090309030903100310031003100310031003100310031003100310031003110311031103110311031103110311031103110311031103110312031203120312031203120312031203120312031203120313031303130313031303130313031303130313031303130314031403140314031403140314031403140314031403140314031503150315031503150315031503150315031503150315031603160316031603160316031603160316031603160316031703170317031703170317031703170317031703170317031703180318031803180318031803180318031803180318031803190319031903190319031903190319031903190319031903200320032003200320032003200320032003200320032003200321032103210321032103210321032103210321032103210322032203220322032203220322032203220322032203220323032303230323032303230323032303230323032303230324032403240324032403240324032403240324032403240324032503250325032503250325032503250325032503250325032603260326032603260326032603260326032603260326032703270327032703270327032703270327032703270327032703280328032803280328032803280328032803280328032803290329032903290329032903290329032903290329032903300330033003300330033003300330033003300330033003300331033103310331033103310331033103310331033103310332033203320332033203320332033203320332033203320333033303330333033303330333033303330333033303330333033403340334033403340334033403340334033403340334033503350335033503350335033503350335033503350335033603360336033603360336033603360336033603360336033603370337033703370337033703370337033703370337033703380338033803380338033803380338033803380338033803390339033903390339033903390339033903390339033903400340034003400340034003400340034003400340034003400341034103410341034103410341034103410341034103410342034203420342034203420342034203420342034203420343034303430343034303430343034303430343034303430343034403440344034403440344034403440344034403440344034503450345034503450345034503450345034503450345034603460346034603460346034603460346034603460346034603470347034703470347034703470347034703470347034703480348034803480348034803480348034803480348034803490349034903490349034903490349034903490349034903490350035003500350035003500350035003500350035003500351035103510351035103510351035103510351035103510352035203520352035203520352035203520352035203520352035303530353035303530353035303530353035303530353035403540354035403540354035403540354035403540354035503550355035503550355035503550355035503550355035603560356035603560356035603560356035603560356035603570357035703570357035703570357035703570357035703580358035803580358035803580358035803580358035803590359035903590359035903590359035903590359035903590360036003600360036003600360036003600360036003600361036103610361036103610361036103610361036103610362036203620362036203620362036203620362036203620362036303630363036303630363036303630363036303630363036403640364036403640364036403640364036403640364036503650365036503650365036503650365036503650365036503660366036603660366036603660366036603660366036603670367036703670367036703670367036703670367036703680368036803680368036803680368036803680368036803680369036903690369036903690369036903690369036903690370037003700370037003700370037003700370037003700371037103710371037103710371037103710371037103710372037203720372037203720372037203720372037203720372037303730373037303730373037303730373037303730373037403740374037403740374037403740374037403740374037503750375037503750375037503750375037503750375037503760376037603760376037603760376037603760376037603770377037703770377037703770377037703770377037703780378037803780378037803780378037803780378037803780379037903790379037903790379037903790379037903790380038003800380038003800380038003800380038003800381038103810381038103810381038103810381038103810381038203820382038203820382038203820382038203820382038303830383038303830383038303830383038303830383038403840384038403840384038403840384038403840384038403850385038503850385038503850385038503850385038503860386038603860386038603860386038603860386038603870387038703870387038703870387038703870387038703880388038803880388038803880388038803880388038803880389038903890389038903890389038903890389038903890390039003900390039003900390039003900390039003900391039103910391039103910391039103910391039103910391039203920392039203920392039203920392039203920392039303930393039303930393039303930393039303930393039403940394039403940394039403940394039403940394039403950395039503950395039503950395039503950395039503960396039603960396039603960396039603960396039603970397039703970397039703970397039703970397039703970398039803980398039803980398039803980398039803980399039903990399039903990399039903990399039903990400040004000400040004000400040004000400040004000400040104010401040104010401040104010401040104010401040204020402040204020402040204020402040204020402040304030403040304030403040304030403040304030403040404040404040404040404040404040404040404040404040404050405040504050405040504050405040504050405040504060406040604060406040604060406"],+ + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "delete", + - "schema": "public", + - "table": "xpto", + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } (3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); - data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"action":"B"} - {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":0.230543947778642},{"name":"bincol","type":"bytea","value":"0420019803930402045901000170038901410282024303210187026304890472032803710073031500080127007204210082021000680057052701150272044603260158034002800265052201570416028404170217048401540192044105030038052102890047010603670493019400360011025500350133054505070479015003050212043102910380030300220250053405340415016404260370020503990096025605130484019301340524020604040564034803890509026105500237048604090546028901300572055500890533038802620377017104790188027401390115017003430257010505610064007803080474061405840428024004710232018501470369015500970465008005050105047600480609003403350113015505150474042506280416049500610088034000510046013403040540037804990034010506640136059300840667003605830049000306210400012201100265061905570244037603950309047000680364052002090684039806060517043600250520058006450610058106860521063406910469035101160587062900550461017604480163050002270235016600530455016104690369070202030396052200820343043206890330024606210319000202540441061501730500035803580227053001360464003103100521050504790261013904590474055202490561015307000521049801960407006702000673052700720086027904450459051602240602022402560148076800030647026001480343075307230603055200960542030406140749072806860162063304380238072507300702040104640131022106990398037606880403023701470558059401140493040306870595014601830411010001140298026907730754051706960682041402800330055105100217012700610091054603070244028000770362079304960226056106500416013407560536044401790480036707150340021102820632055408550294078101190358000506850678025701010760063400430396087006250186041907670083008803400269058507220118004600480410070006210398010705310522047805380328027608060433015405550479056405440214075900640091084801560443020807620268033008120319075506120034023907250583078002880207018505740103063307350677018903780298041002190365050501470528001403620364029107040249062205290882065907780671030006230006051508160599062305030389035206990781066101490032006206710184060706880558000100060301025806480848017903380662087306490312088101860157050308290676090601920396071008740551074509410235093705580946050105610954081308290606067010160956033208950604065407800797081802710623048601720823089509040689042806360621067205610155060400340733054308730540011805150537005108580406067304780152043702620432001907630610086606210477051010640063008006870641023902360678099507950499047409191031102809750832036205830238052010350509096610570201050208550841099302830838106103660444061906130688021105300399072610180234067509640122041702220723066307580668006606300634027300210388001010430680087210041057019605080554090407271100017703341007041810290856054503131087014109960717082810660212032601930235072502040147026411000016018701400539075710690118071900830461058205130344028710740667022500410510096208910422118300420621023907870833039010600772040800600917096208370818108503760904035809740228071300650123019002950165071400701080114900681126057103130716020607140583099811340646071408960277032507800663002111490429025406460496038108430801055103340875041402670947032208540020105710670753040308380662106603150323009206491123077206711039121409330436045700560030000606200373090310470648059701000244062011840056010803150915078701201239111902140615097910060009075009550965119801251025123201320358031210580124097703630227122909980127128911120449091206020573086304280794017201080501018208760152117007750281089007050417125910260163005106890535028406070215041405830007087501700623011410541063092612321175008500640716024112620149052808130871095607370556112507911263030410830514052501341112053310301288117211480987087807140865069608030933004110510834019302010273108411791027025709330438014812460143067403800281040509261334031307151099132302010417079409131239033009570894118411571101004108420881109111070407011012600248025705160636054409310145046912530876015011641083057705310571039408690099130906281281098206710687042603270359084304400184109707030712028212610196043102720004132704261193096010150259006614201148016712770308147607970993069312341330106106050289125202311008048505200798068609611077069108140009040502891046067003570987033105290779064605210077014312291336150107930433027505480670130410441202059102150653015809211485016813360245123504820610070308211150149914820137003200821392139500620651028603421211097001150719063807180940130608810316125810540112151007460604056314641443016314201381030314551467014212991533080600070299045609960416119000581149055813900455088210781530099810200693001415970583148501590425128804680300117606140011112714370019143302861035024015001096141204480890025213480363018407381404089107531400148706331565028503080405059115061032060410120852062408271145003010731023114708601482040011191200077013080293054005551061030304060041023006970354064413010217002202431249089008790415037709111509142103960703124708040156078315911489108304510364047107610778051409971489087616541113109816791363066508810551108912661480091410010171163205560990007513540891159107361352024012170402103200141417081909051371022002901347160809680507043103370055019512681075037011851643137912631273053611320270015813781510056706711526025015060688164517320984125216040202000002740545005604740062115008511268104504750774056010220143083611851546058617640441034902290181104901090148025613831780046213850260101714450743108208101610056500640285135406341325150214850716125902640691171006200925007316891037022401240617020505930195047016291664122708960653102714720720131910091365082406921031155401251302040800120081135000861799055003140068117805240672137810030465120703851377000414301005073609010158025017410862129914450990074418621004082713531093077100271415084112250057152607341077010500651470150500691026062608180039078810731809166604871370076412431352178601710814098309550842050318120166056214420913165715510980122511521052033817911885037806581041028004131538167311910860110610621036193401150059084306261900101411981412194309271032098202140243009105570099004109430768109912281189069209570427156701071507064500941626070509510283065319821501010319720457115109830675140010771242150211200205028602391452149409420424193005300533145711860630110119041597139005561598090006611585136618310564003212321658129307340771150310251015094905121973138104380479192419171684052709971578010603660100172912810771129206200581186606531833149819670523022514371565125603400024119717430469168516310347132700971359085802051733096119600957174511941588025510080168003104440078056206731536006119481884008510711560056106851118091420331218019208031428195117791312081614430415031717041438048817381890056801910455000702530310191903401398137709102095038418392030162020360713093518820381012905731846055008951433200913911051178219691247009519791506041017731853182910150620179814060325169608870226025618382135064319710548034403581457179902210693069020290511195621280336130203622135099600300979162618540214195813831114219016450781215900990580051604480944199500681169049207671018101105400965135318601334130306551367007800841027029520700206142520661874221920291977057903220200153701090269048606081047152016341596025607631238160920851904074721671992178902151838200016601677164416521476138822411804159315361917186820310266066113021922000615640422126109190257091316780173065112100390022909532073193003311459113617391439067110600700031706560460058713271780023213351061066003071995092212331386109818950300149521291266127917681603043805991044189712802119028116040457074822011803021901040822129507731134097817080043004104791963034519941776162909431219090313881828196209560770175412430036221920022266168422260008015211730791130221660150134722100635096201850279038418361235161903700259108823581228187017490099190916072127181409211989182410760781022823970574038013610408102523370596130803190046014919600421041106480393165601242165175820581373149114732308108008950972187311260969002315132348043701162280104114410165108915942150151620130363191612440489166005740121059920841613048007230062146501591203244801820272236206250390220616801850237603120993208118470555245113111815046805112398059211192026222616060271229206000432102005850617129704811251169302150452106701180768207322250133013022011460196801651980188507650598142105022225169703020313213613350906023801231395150418371614196403871735020924861453034400821143182220741311128514402087189203320048159720500354191616601706027919031832169108681133076502941525252305061477142808551561001601281089134314292548088007670307093023842382129017421481043120270820228611511699084319271998238818862513128707350781026707520912137021122359134303970529165613400331145500322094033904691529117001630075026910162025229108071309220921102054037023830184129311372322104424970087158115341443191703651477139207081953029218932120036821670496241718311313108614090790050417850539069104301690037414871549046304170431192323570800074410911517004113880753218617610262000615222115133426220853213504432659268311430402169815221907056619912331100212352014181319880412064120331816140315330886166915412427109201732362195623330090192423241246233313160058153418902072116101720588046320062600088026561918271813350727087202792286057913842464021806122073030925581670157021620243163009552155096421302332156026001595142207231511059106990089132615810371086121691771057223922391266927072195157415101595182103682562121013441924077301251758238615632491111421620396120506991995158215711380056321510987016720380909238608132437118126552812095010571348007018401477184814240228153625522414193809380287111925381875251602671209067204360425159200011247120811951081119921572151256322301155120012402596143127942315100818900398129901540094032526970364154805050806197921150808036104572017145416691314074413750682191225901936164611461869109321660884149605821040159209110865196224771376277915710606068819381068272704962756114212481231183302630929087019272088275901071352072716191942177902982865265522822436111121541087172428520105280526680607264808781869094627312136188606601131104304931240241112282878141500660219134827492525084409071735194326501648205225141370266722162259157901942040075721002709190101700223016926061464008610461532030724101316285802662233161522301912027813011449166309900681093825870877300003413000272522630157295224352791141325240827296328370237126826990506049613022760242815851043085802292044154611761618243411651965242208731205258408070617235522360115013921762981037804012652089009030909061602922510167011592744066727220864230221112042121414842926243310170664305903142923009404552038001808372446269717370268052523610563306109521735273616271385051008510415257320781914242314292943309614080151293815040610188315241456123511290090150716602474207716260310070212611954210217772816252212421781132005510086115305371508130603603028192422611421024603592562033718811086283608242729315215330844196704942639164730420729027912091286036623751830188905222194177224651301002827161665261630590381052927391214009627342763094715300071041831953143115502811167245506510364110025590891011011420172142411712914310706002791027911342340150412321882107421890205114626140204109205530488227230321145264109110494030610241647048024622831018023570194299726401339211409122584076419961543097231550926117910021486167300351285283027012207006430123242172702292459131304101565151101590954286422941876219330670609046707650507140219561520290303551556091032120988313832800731311417250962229630531377057212731540153608550545011930700328073302281101124616443077278112540115103021740031202920160013276818301754040908141502180013932788001629440313056730670068089804640298201017221958176711783226188422192067191709110744193203452591034107580051185725751456130425941058162131690780169107021249199427322988059111350797046330383037255015870570330301470919252804911685258223660887065502840105172319213303251202230608036622363365338228351101077533050752042324632354099923782505192715073003020206871965109813482254120530880760110421890986171925613243167525342663278833172554010202991593247713070541155432532062112900032757311311100659192823270311269634442520022517121636002734040721271427450593181728500896342518712216049134412014257310962019186807483141253426941998285019211977189721500206004921790137077614142907137532482275228031960653100401800610303727761717155811432473120601771670322230520082169114402251190014900919204022742346143701262086019424261769085334411952146929621206320209862360214822032540027918992065036200473519263419641462356304590191236519080318090121052766268729672665108208742077230005253072110026921713007829750043216133430091212124112072000324112536019612010864051721112989330712192379239223113263088010230184036721332899209622142286214107762040223429160850070229213283326131210868050500142999352033500595228621282927194030180320212733912472140818611059006703721843212526261132298433360423264129693570351934813588288333703304348620121785277203001159309724460905191701932783298702613161116624032128230817301808273607061115264905640935257634720640221432932669031823912974148718121740240100411935150130532200097905190912312628472657123518913372236008430221330534413723022719503318291822722001218800400096020924610137216102383215063912253741156006332869049318781029014305091879036700881596036503173563371132602096196917052138206819180854220703291094168009742329168025472969079730471086183531941601373135661691155701502011136201021508347620873229183903781368270126031701000504972684235421911448154229960712263910370121044109853716214625560052035701110154187836162259130916472641269005421438057505481940328229210315090706403336162633000542174937481536165120670266170424280378186104700169028417911829294706442377053812252931249406692012281415852659230832252116285711172020053127820228079906222676118024983152135127861073319618701723170424132959076610343636279538711337157723000687371112771814184418130711207526201339086238123858012512612752120705650719294422833152200530570271174519480245309435392563379033483853168512721745240333650447375402940345370004201617252916372187325606540537248226753618275704781626300635971232162834550642154611891925330736121346375934251643013531802068176517533719397110530398053135553094019123483578183013883214307330302704372205943904166639273545302437152996067838542196276216273964250216181015290421540583200823492950159501740329081232713383353729983984344506493913298836973625197403463475015131301077010416122708112804940835171625183203064000763380097208952624032504031588028138752243016128261906381507522257325209041343026810102968299821473468384138781929299104442007231714232910087617523318247720363133064722001889256919502648074611293561210014000478098703162642037500792442231930932891022913160213316121991978238705774031142412302127332938194094187104441104132925602515181235572835033839382917279821361894157023693220178614081291378038151873369210993113168302982806165121833255276435241674113611861093399315280892276501773045050217591258374635592678087031902342275827293451171102413754035119041766363104981124112616422320222814683861312800544042199505591612326401270991175510044205411637832743338112932987294716480687050610851189163922202845397702380097363933890151348011670715087002190843186919881855186418931423038310542727339340230139408802831231103519353468390116843710400110902865415703324043061412094267146330922001333306993909049410850696324102250468338300600754034111032703383507450112328504851210188003781546165709962765165724711581367315272286330820253381401109813609017400773673093304210470365742831220377232741709067108452091222925153096068741851256227935552795024825530499365422561487295024321566230733741991278227111957401321620904138428391756349207294290225414214147352037173366197239701573247632843846397618851925118242100949318826373680078122991478169236954338346228270687339507092118318242551469218018481072376543434379324039481878077707361713173339474370103003252276251920291584247311000014316601000728088033050590236010762451344104402397342237031942088200522685260817972222257028362552042109300152201734211260203321621361276830490236336409721319137744381763379134251030128543151083399024762893176005951279433110202216001130521185127906213362265034081951288923122931422036992912150730271870254543241720363738464215205311200315334209771342106909884416226322770533113804343965310433441779153930760985447200734034183426363864356717713209328338394339360326720791042037511786032814924080086426394520031212193342210327701891309627221967260600150066194036071849061323541154041914183845121518433056301521744560255330452646253033623875131809032086322440210245062220620261068840173892255000461672371304683102299116920361147101282549146126981013412606414398342219680700091306030135116112292211142419221637072444911684240836082156090619943861127034763992383703162077022444692723001432780067071941990674085607261911308221603848008328903719177906622698395115750049318128543548254020553868463322823702270922982334277830231890345838872622070723140120458123993030364441913699167734830598172719973471060845560848450145263146353325570761118406533805308841343014102301400636114400403051419537092556320506821346380924213357258330343221343928413052188016700897264828641555174512390981004322691123068334231165375429040153158313840840293904693277156830691579005617774439312736711363403215764247083633340730182533803015295640691690413030764614428746721232035728531704365544320011046244911800014228530706151521212293099629640854173100054256476729803552166823351846150718451741274822054614446510724264447815383970147416822023218532074159449442122319053011292326481410960494355927762845058342944704233622222085213918743165158715364715073530211561277203704790210600394175444205720455192505551558242341384353042247273810028722111177238543653064069710894612056518302775213646203149207318583190138914413768184833794329341709263600290513513462184116410788302740420277120847461374094204093216373525582954199346464826028711291359407929904760351515070770221444312130077013563782156344032918184406852760322716333173152404510806449824570536440927471673083019034683066704871247144227150748358634922113243301041581040619592272318302383917140617724373221813241872275907834638444416191573417622912064044737444797120023653323332748153429492002300406221134330646"}]} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":11},{"name":"bincol","type":"bytea","value":"0041004100410041004100410041004100410041004100420042004200420042004200420042004200420042004200420043004300430043004300430043004300430043004300430044004400440044004400440044004400440044004400440045004500450045004500450045004500450045004500450045004600460046004600460046004600460046004600460046004700470047004700470047004700470047004700470047004800480048004800480048004800480048004800480048004800490049004900490049004900490049004900490049004900500050005000500050005000500050005000500050005000510051005100510051005100510051005100510051005100510052005200520052005200520052005200520052005200520053005300530053005300530053005300530053005300530054005400540054005400540054005400540054005400540054005500550055005500550055005500550055005500550055005600560056005600560056005600560056005600560056005700570057005700570057005700570057005700570057005800580058005800580058005800580058005800580058005800590059005900590059005900590059005900590059005900600060006000600060006000600060006000600060006000610061006100610061006100610061006100610061006100610062006200620062006200620062006200620062006200620063006300630063006300630063006300630063006300630064006400640064006400640064006400640064006400640064006500650065006500650065006500650065006500650065006600660066006600660066006600660066006600660066006700670067006700670067006700670067006700670067006700680068006800680068006800680068006800680068006800690069006900690069006900690069006900690069006900700070007000700070007000700070007000700070007000700071007100710071007100710071007100710071007100710072007200720072007200720072007200720072007200720073007300730073007300730073007300730073007300730074007400740074007400740074007400740074007400740074007500750075007500750075007500750075007500750075007600760076007600760076007600760076007600760076007700770077007700770077007700770077007700770077007700780078007800780078007800780078007800780078007800790079007900790079007900790079007900790079007900800080008000800080008000800080008000800080008000800081008100810081008100810081008100810081008100810082008200820082008200820082008200820082008200820083008300830083008300830083008300830083008300830083008400840084008400840084008400840084008400840084008500850085008500850085008500850085008500850085008600860086008600860086008600860086008600860086008600870087008700870087008700870087008700870087008700880088008800880088008800880088008800880088008800890089008900890089008900890089008900890089008900900090009000900090009000900090009000900090009000900091009100910091009100910091009100910091009100910092009200920092009200920092009200920092009200920093009300930093009300930093009300930093009300930093009400940094009400940094009400940094009400940094009500950095009500950095009500950095009500950095009600960096009600960096009600960096009600960096009600970097009700970097009700970097009700970097009700980098009800980098009800980098009800980098009800990099009900990099009900990099009900990099009900990100010001000100010001000100010001000100010001000101010101010101010101010101010101010101010101010102010201020102010201020102010201020102010201020102010301030103010301030103010301030103010301030103010401040104010401040104010401040104010401040104010501050105010501050105010501050105010501050105010601060106010601060106010601060106010601060106010601070107010701070107010701070107010701070107010701080108010801080108010801080108010801080108010801090109010901090109010901090109010901090109010901090110011001100110011001100110011001100110011001100111011101110111011101110111011101110111011101110112011201120112011201120112011201120112011201120112011301130113011301130113011301130113011301130113011401140114011401140114011401140114011401140114011501150115011501150115011501150115011501150115011501160116011601160116011601160116011601160116011601170117011701170117011701170117011701170117011701180118011801180118011801180118011801180118011801190119011901190119011901190119011901190119011901190120012001200120012001200120012001200120012001200121012101210121012101210121012101210121012101210122012201220122012201220122012201220122012201220122012301230123012301230123012301230123012301230123012401240124012401240124012401240124012401240124012501250125012501250125012501250125012501250125012501260126012601260126012601260126012601260126012601270127012701270127012701270127012701270127012701280128012801280128012801280128012801280128012801280129012901290129012901290129012901290129012901290130013001300130013001300130013001300130013001300131013101310131013101310131013101310131013101310131013201320132013201320132013201320132013201320132013301330133013301330133013301330133013301330133013401340134013401340134013401340134013401340134013501350135013501350135013501350135013501350135013501360136013601360136013601360136013601360136013601370137013701370137013701370137013701370137013701380138013801380138013801380138013801380138013801380139013901390139013901390139013901390139013901390140014001400140014001400140014001400140014001400141014101410141014101410141014101410141014101410141014201420142014201420142014201420142014201420142014301430143014301430143014301430143014301430143014401440144014401440144014401440144014401440144014401450145014501450145014501450145014501450145014501460146014601460146014601460146014601460146014601470147014701470147014701470147014701470147014701470148014801480148014801480148014801480148014801480149014901490149014901490149014901490149014901490150015001500150015001500150015001500150015001500151015101510151015101510151015101510151015101510151015201520152015201520152015201520152015201520152015301530153015301530153015301530153015301530153015401540154015401540154015401540154015401540154015401550155015501550155015501550155015501550155015501560156015601560156015601560156015601560156015601570157015701570157015701570157015701570157015701570158015801580158015801580158015801580158015801580159015901590159015901590159015901590159015901590160016001600160016001600160016001600160016001600160016101610161016101610161016101610161016101610161016201620162016201620162016201620162016201620162016301630163016301630163016301630163016301630163016301640164016401640164016401640164016401640164016401650165016501650165016501650165016501650165016501660166016601660166016601660166016601660166016601670167016701670167016701670167016701670167016701670168016801680168016801680168016801680168016801680169016901690169016901690169016901690169016901690170017001700170017001700170017001700170017001700170017101710171017101710171017101710171017101710171017201720172017201720172017201720172017201720172017301730173017301730173017301730173017301730173017301740174017401740174017401740174017401740174017401750175017501750175017501750175017501750175017501760176017601760176017601760176017601760176017601760177017701770177017701770177017701770177017701770178017801780178017801780178017801780178017801780179017901790179017901790179017901790179017901790179018001800180018001800180018001800180018001800180018101810181018101810181018101810181018101810181018201820182018201820182018201820182018201820182018301830183018301830183018301830183018301830183018301840184018401840184018401840184018401840184018401850185018501850185018501850185018501850185018501860186018601860186018601860186018601860186018601860187018701870187018701870187018701870187018701870188018801880188018801880188018801880188018801880189018901890189018901890189018901890189018901890189019001900190019001900190019001900190019001900190019101910191019101910191019101910191019101910191019201920192019201920192019201920192019201920192019201930193019301930193019301930193019301930193019301940194019401940194019401940194019401940194019401950195019501950195019501950195019501950195019501950196019601960196019601960196019601960196019601960197019701970197019701970197019701970197019701970198019801980198019801980198019801980198019801980199019901990199019901990199019901990199019901990199020002000200020002000200020002000200020002000200020102010201020102010201020102010201020102010201020202020202020202020202020202020202020202020202020202030203020302030203020302030203020302030203020302040204020402040204020402040204020402040204020402050205020502050205020502050205020502050205020502050206020602060206020602060206020602060206020602060207020702070207020702070207020702070207020702070208020802080208020802080208020802080208020802080208020902090209020902090209020902090209020902090209021002100210021002100210021002100210021002100210021102110211021102110211021102110211021102110211021102120212021202120212021202120212021202120212021202130213021302130213021302130213021302130213021302140214021402140214021402140214021402140214021402150215021502150215021502150215021502150215021502150216021602160216021602160216021602160216021602160217021702170217021702170217021702170217021702170218021802180218021802180218021802180218021802180218021902190219021902190219021902190219021902190219022002200220022002200220022002200220022002200220022102210221022102210221022102210221022102210221022102220222022202220222022202220222022202220222022202230223022302230223022302230223022302230223022302240224022402240224022402240224022402240224022402240225022502250225022502250225022502250225022502250226022602260226022602260226022602260226022602260227022702270227022702270227022702270227022702270227022802280228022802280228022802280228022802280228022902290229022902290229022902290229022902290229023002300230023002300230023002300230023002300230023102310231023102310231023102310231023102310231023102320232023202320232023202320232023202320232023202330233023302330233023302330233023302330233023302340234023402340234023402340234023402340234023402340235023502350235023502350235023502350235023502350236023602360236023602360236023602360236023602360237023702370237023702370237023702370237023702370237023802380238023802380238023802380238023802380238023902390239023902390239023902390239023902390239024002400240024002400240024002400240024002400240024002410241024102410241024102410241024102410241024102420242024202420242024202420242024202420242024202430243024302430243024302430243024302430243024302430244024402440244024402440244024402440244024402440245024502450245024502450245024502450245024502450246024602460246024602460246024602460246024602460247024702470247024702470247024702470247024702470247024802480248024802480248024802480248024802480248024902490249024902490249024902490249024902490249025002500250025002500250025002500250025002500250025002510251025102510251025102510251025102510251025102520252025202520252025202520252025202520252025202530253025302530253025302530253025302530253025302530254025402540254025402540254025402540254025402540255025502550255025502550255025502550255025502550256025602560256025602560256025602560256025602560256025702570257025702570257025702570257025702570257025802580258025802580258025802580258025802580258025902590259025902590259025902590259025902590259025902600260026002600260026002600260026002600260026002610261026102610261026102610261026102610261026102620262026202620262026202620262026202620262026202630263026302630263026302630263026302630263026302630264026402640264026402640264026402640264026402640265026502650265026502650265026502650265026502650266026602660266026602660266026602660266026602660266026702670267026702670267026702670267026702670267026802680268026802680268026802680268026802680268026902690269026902690269026902690269026902690269026902700270027002700270027002700270027002700270027002710271027102710271027102710271027102710271027102720272027202720272027202720272027202720272027202720273027302730273027302730273027302730273027302730274027402740274027402740274027402740274027402740275027502750275027502750275027502750275027502750275027602760276027602760276027602760276027602760276027702770277027702770277027702770277027702770277027802780278027802780278027802780278027802780278027902790279027902790279027902790279027902790279027902800280028002800280028002800280028002800280028002810281028102810281028102810281028102810281028102820282028202820282028202820282028202820282028202820283028302830283028302830283028302830283028302830284028402840284028402840284028402840284028402840285028502850285028502850285028502850285028502850285028602860286028602860286028602860286028602860286028702870287028702870287028702870287028702870287028802880288028802880288028802880288028802880288028802890289028902890289028902890289028902890289028902900290029002900290029002900290029002900290029002910291029102910291029102910291029102910291029102910292029202920292029202920292029202920292029202920293029302930293029302930293029302930293029302930294029402940294029402940294029402940294029402940295029502950295029502950295029502950295029502950295029602960296029602960296029602960296029602960296029702970297029702970297029702970297029702970297029802980298029802980298029802980298029802980298029802990299029902990299029902990299029902990299029903000300030003000300030003000300030003000300030003010301030103010301030103010301030103010301030103010302030203020302030203020302030203020302030203020303030303030303030303030303030303030303030303030304030403040304030403040304030403040304030403040304030503050305030503050305030503050305030503050305030603060306030603060306030603060306030603060306030703070307030703070307030703070307030703070307030703080308030803080308030803080308030803080308030803090309030903090309030903090309030903090309030903100310031003100310031003100310031003100310031003110311031103110311031103110311031103110311031103110312031203120312031203120312031203120312031203120313031303130313031303130313031303130313031303130314031403140314031403140314031403140314031403140314031503150315031503150315031503150315031503150315031603160316031603160316031603160316031603160316031703170317031703170317031703170317031703170317031703180318031803180318031803180318031803180318031803190319031903190319031903190319031903190319031903200320032003200320032003200320032003200320032003200321032103210321032103210321032103210321032103210322032203220322032203220322032203220322032203220323032303230323032303230323032303230323032303230324032403240324032403240324032403240324032403240324032503250325032503250325032503250325032503250325032603260326032603260326032603260326032603260326032703270327032703270327032703270327032703270327032703280328032803280328032803280328032803280328032803290329032903290329032903290329032903290329032903300330033003300330033003300330033003300330033003300331033103310331033103310331033103310331033103310332033203320332033203320332033203320332033203320333033303330333033303330333033303330333033303330333033403340334033403340334033403340334033403340334033503350335033503350335033503350335033503350335033603360336033603360336033603360336033603360336033603370337033703370337033703370337033703370337033703380338033803380338033803380338033803380338033803390339033903390339033903390339033903390339033903400340034003400340034003400340034003400340034003400341034103410341034103410341034103410341034103410342034203420342034203420342034203420342034203420343034303430343034303430343034303430343034303430343034403440344034403440344034403440344034403440344034503450345034503450345034503450345034503450345034603460346034603460346034603460346034603460346034603470347034703470347034703470347034703470347034703480348034803480348034803480348034803480348034803490349034903490349034903490349034903490349034903490350035003500350035003500350035003500350035003500351035103510351035103510351035103510351035103510352035203520352035203520352035203520352035203520352035303530353035303530353035303530353035303530353035403540354035403540354035403540354035403540354035503550355035503550355035503550355035503550355035603560356035603560356035603560356035603560356035603570357035703570357035703570357035703570357035703580358035803580358035803580358035803580358035803590359035903590359035903590359035903590359035903590360036003600360036003600360036003600360036003600361036103610361036103610361036103610361036103610362036203620362036203620362036203620362036203620362036303630363036303630363036303630363036303630363036403640364036403640364036403640364036403640364036503650365036503650365036503650365036503650365036503660366036603660366036603660366036603660366036603670367036703670367036703670367036703670367036703680368036803680368036803680368036803680368036803680369036903690369036903690369036903690369036903690370037003700370037003700370037003700370037003700371037103710371037103710371037103710371037103710372037203720372037203720372037203720372037203720372037303730373037303730373037303730373037303730373037403740374037403740374037403740374037403740374037503750375037503750375037503750375037503750375037503760376037603760376037603760376037603760376037603770377037703770377037703770377037703770377037703780378037803780378037803780378037803780378037803780379037903790379037903790379037903790379037903790380038003800380038003800380038003800380038003800381038103810381038103810381038103810381038103810381038203820382038203820382038203820382038203820382038303830383038303830383038303830383038303830383038403840384038403840384038403840384038403840384038403850385038503850385038503850385038503850385038503860386038603860386038603860386038603860386038603870387038703870387038703870387038703870387038703880388038803880388038803880388038803880388038803880389038903890389038903890389038903890389038903890390039003900390039003900390039003900390039003900391039103910391039103910391039103910391039103910391039203920392039203920392039203920392039203920392039303930393039303930393039303930393039303930393039403940394039403940394039403940394039403940394039403950395039503950395039503950395039503950395039503960396039603960396039603960396039603960396039603970397039703970397039703970397039703970397039703970398039803980398039803980398039803980398039803980399039903990399039903990399039903990399039903990400040004000400040004000400040004000400040004000400040104010401040104010401040104010401040104010401040204020402040204020402040204020402040204020402040304030403040304030403040304030403040304030403040404040404040404040404040404040404040404040404040404050405040504050405040504050405040504050405040504060406040604060406040604060406"}]} {"action":"C"} {"action":"B"} - {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456},{"name":"bincol","type":"bytea","value":"0041004100410041004100410041004100410041004100420042004200420042004200420042004200420042004200420043004300430043004300430043004300430043004300430044004400440044004400440044004400440044004400440045004500450045004500450045004500450045004500450045004600460046004600460046004600460046004600460046004700470047004700470047004700470047004700470047004800480048004800480048004800480048004800480048004800490049004900490049004900490049004900490049004900500050005000500050005000500050005000500050005000510051005100510051005100510051005100510051005100510052005200520052005200520052005200520052005200520053005300530053005300530053005300530053005300530054005400540054005400540054005400540054005400540054005500550055005500550055005500550055005500550055005600560056005600560056005600560056005600560056005700570057005700570057005700570057005700570057005800580058005800580058005800580058005800580058005800590059005900590059005900590059005900590059005900600060006000600060006000600060006000600060006000610061006100610061006100610061006100610061006100610062006200620062006200620062006200620062006200620063006300630063006300630063006300630063006300630064006400640064006400640064006400640064006400640064006500650065006500650065006500650065006500650065006600660066006600660066006600660066006600660066006700670067006700670067006700670067006700670067006700680068006800680068006800680068006800680068006800690069006900690069006900690069006900690069006900700070007000700070007000700070007000700070007000700071007100710071007100710071007100710071007100710072007200720072007200720072007200720072007200720073007300730073007300730073007300730073007300730074007400740074007400740074007400740074007400740074007500750075007500750075007500750075007500750075007600760076007600760076007600760076007600760076007700770077007700770077007700770077007700770077007700780078007800780078007800780078007800780078007800790079007900790079007900790079007900790079007900800080008000800080008000800080008000800080008000800081008100810081008100810081008100810081008100810082008200820082008200820082008200820082008200820083008300830083008300830083008300830083008300830083008400840084008400840084008400840084008400840084008500850085008500850085008500850085008500850085008600860086008600860086008600860086008600860086008600870087008700870087008700870087008700870087008700880088008800880088008800880088008800880088008800890089008900890089008900890089008900890089008900900090009000900090009000900090009000900090009000900091009100910091009100910091009100910091009100910092009200920092009200920092009200920092009200920093009300930093009300930093009300930093009300930093009400940094009400940094009400940094009400940094009500950095009500950095009500950095009500950095009600960096009600960096009600960096009600960096009600970097009700970097009700970097009700970097009700980098009800980098009800980098009800980098009800990099009900990099009900990099009900990099009900990100010001000100010001000100010001000100010001000101010101010101010101010101010101010101010101010102010201020102010201020102010201020102010201020102010301030103010301030103010301030103010301030103010401040104010401040104010401040104010401040104010501050105010501050105010501050105010501050105010601060106010601060106010601060106010601060106010601070107010701070107010701070107010701070107010701080108010801080108010801080108010801080108010801090109010901090109010901090109010901090109010901090110011001100110011001100110011001100110011001100111011101110111011101110111011101110111011101110112011201120112011201120112011201120112011201120112011301130113011301130113011301130113011301130113011401140114011401140114011401140114011401140114011501150115011501150115011501150115011501150115011501160116011601160116011601160116011601160116011601170117011701170117011701170117011701170117011701180118011801180118011801180118011801180118011801190119011901190119011901190119011901190119011901190120012001200120012001200120012001200120012001200121012101210121012101210121012101210121012101210122012201220122012201220122012201220122012201220122012301230123012301230123012301230123012301230123012401240124012401240124012401240124012401240124012501250125012501250125012501250125012501250125012501260126012601260126012601260126012601260126012601270127012701270127012701270127012701270127012701280128012801280128012801280128012801280128012801280129012901290129012901290129012901290129012901290130013001300130013001300130013001300130013001300131013101310131013101310131013101310131013101310131013201320132013201320132013201320132013201320132013301330133013301330133013301330133013301330133013401340134013401340134013401340134013401340134013501350135013501350135013501350135013501350135013501360136013601360136013601360136013601360136013601370137013701370137013701370137013701370137013701380138013801380138013801380138013801380138013801380139013901390139013901390139013901390139013901390140014001400140014001400140014001400140014001400141014101410141014101410141014101410141014101410141014201420142014201420142014201420142014201420142014301430143014301430143014301430143014301430143014401440144014401440144014401440144014401440144014401450145014501450145014501450145014501450145014501460146014601460146014601460146014601460146014601470147014701470147014701470147014701470147014701470148014801480148014801480148014801480148014801480149014901490149014901490149014901490149014901490150015001500150015001500150015001500150015001500151015101510151015101510151015101510151015101510151015201520152015201520152015201520152015201520152015301530153015301530153015301530153015301530153015401540154015401540154015401540154015401540154015401550155015501550155015501550155015501550155015501560156015601560156015601560156015601560156015601570157015701570157015701570157015701570157015701570158015801580158015801580158015801580158015801580159015901590159015901590159015901590159015901590160016001600160016001600160016001600160016001600160016101610161016101610161016101610161016101610161016201620162016201620162016201620162016201620162016301630163016301630163016301630163016301630163016301640164016401640164016401640164016401640164016401650165016501650165016501650165016501650165016501660166016601660166016601660166016601660166016601670167016701670167016701670167016701670167016701670168016801680168016801680168016801680168016801680169016901690169016901690169016901690169016901690170017001700170017001700170017001700170017001700170017101710171017101710171017101710171017101710171017201720172017201720172017201720172017201720172017301730173017301730173017301730173017301730173017301740174017401740174017401740174017401740174017401750175017501750175017501750175017501750175017501760176017601760176017601760176017601760176017601760177017701770177017701770177017701770177017701770178017801780178017801780178017801780178017801780179017901790179017901790179017901790179017901790179018001800180018001800180018001800180018001800180018101810181018101810181018101810181018101810181018201820182018201820182018201820182018201820182018301830183018301830183018301830183018301830183018301840184018401840184018401840184018401840184018401850185018501850185018501850185018501850185018501860186018601860186018601860186018601860186018601860187018701870187018701870187018701870187018701870188018801880188018801880188018801880188018801880189018901890189018901890189018901890189018901890189019001900190019001900190019001900190019001900190019101910191019101910191019101910191019101910191019201920192019201920192019201920192019201920192019201930193019301930193019301930193019301930193019301940194019401940194019401940194019401940194019401950195019501950195019501950195019501950195019501950196019601960196019601960196019601960196019601960197019701970197019701970197019701970197019701970198019801980198019801980198019801980198019801980199019901990199019901990199019901990199019901990199020002000200020002000200020002000200020002000200020102010201020102010201020102010201020102010201020202020202020202020202020202020202020202020202020202030203020302030203020302030203020302030203020302040204020402040204020402040204020402040204020402050205020502050205020502050205020502050205020502050206020602060206020602060206020602060206020602060207020702070207020702070207020702070207020702070208020802080208020802080208020802080208020802080208020902090209020902090209020902090209020902090209021002100210021002100210021002100210021002100210021102110211021102110211021102110211021102110211021102120212021202120212021202120212021202120212021202130213021302130213021302130213021302130213021302140214021402140214021402140214021402140214021402150215021502150215021502150215021502150215021502150216021602160216021602160216021602160216021602160217021702170217021702170217021702170217021702170218021802180218021802180218021802180218021802180218021902190219021902190219021902190219021902190219022002200220022002200220022002200220022002200220022102210221022102210221022102210221022102210221022102220222022202220222022202220222022202220222022202230223022302230223022302230223022302230223022302240224022402240224022402240224022402240224022402240225022502250225022502250225022502250225022502250226022602260226022602260226022602260226022602260227022702270227022702270227022702270227022702270227022802280228022802280228022802280228022802280228022902290229022902290229022902290229022902290229023002300230023002300230023002300230023002300230023102310231023102310231023102310231023102310231023102320232023202320232023202320232023202320232023202330233023302330233023302330233023302330233023302340234023402340234023402340234023402340234023402340235023502350235023502350235023502350235023502350236023602360236023602360236023602360236023602360237023702370237023702370237023702370237023702370237023802380238023802380238023802380238023802380238023902390239023902390239023902390239023902390239024002400240024002400240024002400240024002400240024002410241024102410241024102410241024102410241024102420242024202420242024202420242024202420242024202430243024302430243024302430243024302430243024302430244024402440244024402440244024402440244024402440245024502450245024502450245024502450245024502450246024602460246024602460246024602460246024602460247024702470247024702470247024702470247024702470247024802480248024802480248024802480248024802480248024902490249024902490249024902490249024902490249025002500250025002500250025002500250025002500250025002510251025102510251025102510251025102510251025102520252025202520252025202520252025202520252025202530253025302530253025302530253025302530253025302530254025402540254025402540254025402540254025402540255025502550255025502550255025502550255025502550256025602560256025602560256025602560256025602560256025702570257025702570257025702570257025702570257025802580258025802580258025802580258025802580258025902590259025902590259025902590259025902590259025902600260026002600260026002600260026002600260026002610261026102610261026102610261026102610261026102620262026202620262026202620262026202620262026202630263026302630263026302630263026302630263026302630264026402640264026402640264026402640264026402640265026502650265026502650265026502650265026502650266026602660266026602660266026602660266026602660266026702670267026702670267026702670267026702670267026802680268026802680268026802680268026802680268026902690269026902690269026902690269026902690269026902700270027002700270027002700270027002700270027002710271027102710271027102710271027102710271027102720272027202720272027202720272027202720272027202720273027302730273027302730273027302730273027302730274027402740274027402740274027402740274027402740275027502750275027502750275027502750275027502750275027602760276027602760276027602760276027602760276027702770277027702770277027702770277027702770277027802780278027802780278027802780278027802780278027902790279027902790279027902790279027902790279027902800280028002800280028002800280028002800280028002810281028102810281028102810281028102810281028102820282028202820282028202820282028202820282028202820283028302830283028302830283028302830283028302830284028402840284028402840284028402840284028402840285028502850285028502850285028502850285028502850285028602860286028602860286028602860286028602860286028702870287028702870287028702870287028702870287028802880288028802880288028802880288028802880288028802890289028902890289028902890289028902890289028902900290029002900290029002900290029002900290029002910291029102910291029102910291029102910291029102910292029202920292029202920292029202920292029202920293029302930293029302930293029302930293029302930294029402940294029402940294029402940294029402940295029502950295029502950295029502950295029502950295029602960296029602960296029602960296029602960296029702970297029702970297029702970297029702970297029802980298029802980298029802980298029802980298029802990299029902990299029902990299029902990299029903000300030003000300030003000300030003000300030003010301030103010301030103010301030103010301030103010302030203020302030203020302030203020302030203020303030303030303030303030303030303030303030303030304030403040304030403040304030403040304030403040304030503050305030503050305030503050305030503050305030603060306030603060306030603060306030603060306030703070307030703070307030703070307030703070307030703080308030803080308030803080308030803080308030803090309030903090309030903090309030903090309030903100310031003100310031003100310031003100310031003110311031103110311031103110311031103110311031103110312031203120312031203120312031203120312031203120313031303130313031303130313031303130313031303130314031403140314031403140314031403140314031403140314031503150315031503150315031503150315031503150315031603160316031603160316031603160316031603160316031703170317031703170317031703170317031703170317031703180318031803180318031803180318031803180318031803190319031903190319031903190319031903190319031903200320032003200320032003200320032003200320032003200321032103210321032103210321032103210321032103210322032203220322032203220322032203220322032203220323032303230323032303230323032303230323032303230324032403240324032403240324032403240324032403240324032503250325032503250325032503250325032503250325032603260326032603260326032603260326032603260326032703270327032703270327032703270327032703270327032703280328032803280328032803280328032803280328032803290329032903290329032903290329032903290329032903300330033003300330033003300330033003300330033003300331033103310331033103310331033103310331033103310332033203320332033203320332033203320332033203320333033303330333033303330333033303330333033303330333033403340334033403340334033403340334033403340334033503350335033503350335033503350335033503350335033603360336033603360336033603360336033603360336033603370337033703370337033703370337033703370337033703380338033803380338033803380338033803380338033803390339033903390339033903390339033903390339033903400340034003400340034003400340034003400340034003400341034103410341034103410341034103410341034103410342034203420342034203420342034203420342034203420343034303430343034303430343034303430343034303430343034403440344034403440344034403440344034403440344034503450345034503450345034503450345034503450345034603460346034603460346034603460346034603460346034603470347034703470347034703470347034703470347034703480348034803480348034803480348034803480348034803490349034903490349034903490349034903490349034903490350035003500350035003500350035003500350035003500351035103510351035103510351035103510351035103510352035203520352035203520352035203520352035203520352035303530353035303530353035303530353035303530353035403540354035403540354035403540354035403540354035503550355035503550355035503550355035503550355035603560356035603560356035603560356035603560356035603570357035703570357035703570357035703570357035703580358035803580358035803580358035803580358035803590359035903590359035903590359035903590359035903590360036003600360036003600360036003600360036003600361036103610361036103610361036103610361036103610362036203620362036203620362036203620362036203620362036303630363036303630363036303630363036303630363036403640364036403640364036403640364036403640364036503650365036503650365036503650365036503650365036503660366036603660366036603660366036603660366036603670367036703670367036703670367036703670367036703680368036803680368036803680368036803680368036803680369036903690369036903690369036903690369036903690370037003700370037003700370037003700370037003700371037103710371037103710371037103710371037103710372037203720372037203720372037203720372037203720372037303730373037303730373037303730373037303730373037403740374037403740374037403740374037403740374037503750375037503750375037503750375037503750375037503760376037603760376037603760376037603760376037603770377037703770377037703770377037703770377037703780378037803780378037803780378037803780378037803780379037903790379037903790379037903790379037903790380038003800380038003800380038003800380038003800381038103810381038103810381038103810381038103810381038203820382038203820382038203820382038203820382038303830383038303830383038303830383038303830383038403840384038403840384038403840384038403840384038403850385038503850385038503850385038503850385038503860386038603860386038603860386038603860386038603870387038703870387038703870387038703870387038703880388038803880388038803880388038803880388038803880389038903890389038903890389038903890389038903890390039003900390039003900390039003900390039003900391039103910391039103910391039103910391039103910391039203920392039203920392039203920392039203920392039303930393039303930393039303930393039303930393039403940394039403940394039403940394039403940394039403950395039503950395039503950395039503950395039503960396039603960396039603960396039603960396039603970397039703970397039703970397039703970397039703970398039803980398039803980398039803980398039803980399039903990399039903990399039903990399039903990400040004000400040004000400040004000400040004000400040104010401040104010401040104010401040104010401040204020402040204020402040204020402040204020402040304030403040304030403040304030403040304030403040404040404040404040404040404040404040404040404040404050405040504050405040504050405040504050405040504060406040604060406040604060406"}],"identity":[{"name":"id","type":"integer","value":1}]} {"action":"C"} {"action":"B"} {"action":"D","schema":"public","table":"xpto","identity":[{"name":"id","type":"integer","value":1}]} diff --git a/expected/toast.out b/expected/toast.out index 5ceab77246a0..e4897a6a27b1 100644 --- a/expected/toast.out +++ b/expected/toast.out @@ -3,18 +3,15 @@ SET synchronous_commit = on; SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; -SELECT setseed(0); - setseed ---------- - -(1 row) - +DROP SEQUENCE IF EXISTS xpto_rand_seq; +NOTICE: sequence "xpto_rand_seq" does not exist, skipping +CREATE SEQUENCE xpto_rand_seq START 11 INCREMENT 997; CREATE TABLE xpto ( id serial primary key, toasted_col1 text, -rand1 float8 DEFAULT random(), +rand1 float8 DEFAULT nextval('xpto_rand_seq'), toasted_col2 text, -rand2 float8 DEFAULT random() +rand2 float8 DEFAULT nextval('xpto_rand_seq') ); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? @@ -31,96 +28,96 @@ UPDATE xpto SET toasted_col1 = (SELECT string_agg(g.i::text, '') FROM generate_s UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0'); - data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + - "columntypes": ["int4", "text", "float8", "text", "float8"], + - "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 0.840187716763467, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 0.394382926635444] + - } + - ] + + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + + "columntypes": ["int4", "text", "float8", "text", "float8"], + + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 11, "24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000", 1008] + + } + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + - "columntypes": ["int4", "text", "float8", "text", "float8"], + - "columnvalues": [2, null, 0.783099223393947, "0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500", 0.798440033104271]+ - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "toasted_col2", "rand2"], + + "columntypes": ["int4", "text", "float8", "text", "float8"], + + "columnvalues": [2, null, 2005, "0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500", 3002]+ + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "toasted_col1", "rand1", "rand2"], + - "columntypes": ["int4", "text", "float8", "float8"], + - "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 0.840187716763467, 0.394382926635444], + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "toasted_col1", "rand1", "rand2"], + + "columntypes": ["int4", "text", "float8", "float8"], + + "columnvalues": [1, "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000", 11, 1008], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "xpto", + - "columnnames": ["id", "rand1", "rand2"], + - "columntypes": ["int4", "float8", "float8"], + - "columnvalues": [1, 123.456, 0.394382926635444], + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "xpto", + + "columnnames": ["id", "rand1", "rand2"], + + "columntypes": ["int4", "float8", "float8"], + + "columnvalues": [1, 123.456, 1008], + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "delete", + - "schema": "public", + - "table": "xpto", + - "oldkeys": { + - "keynames": ["id"], + - "keytypes": ["int4"], + - "keyvalues": [1] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "xpto", + + "oldkeys": { + + "keynames": ["id"], + + "keytypes": ["int4"], + + "keyvalues": [1] + + } + + } + + ] + } (5 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); - data --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ {"action":"B"} - {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":0.840187716763467},{"name":"toasted_col2","type":"text","value":"24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000"},{"name":"rand2","type":"double precision","value":0.394382926635444}]} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":11},{"name":"toasted_col2","type":"text","value":"24681012141618202224262830323436384042444648505254565860626466687072747678808284868890929496981001021041061081101121141161181201221241261281301321341361381401421441461481501521541561581601621641661681701721741761781801821841861881901921941961982002022042062082102122142162182202222242262282302322342362382402422442462482502522542562582602622642662682702722742762782802822842862882902922942962983003023043063083103123143163183203223243263283303323343363383403423443463483503523543563583603623643663683703723743763783803823843863883903923943963984004024044064084104124144164184204224244264284304324344364384404424444464484504524544564584604624644664684704724744764784804824844864884904924944964985005025045065085105125145165185205225245265285305325345365385405425445465485505525545565585605625645665685705725745765785805825845865885905925945965986006026046066086106126146166186206226246266286306326346366386406426446466486506526546566586606626646666686706726746766786806826846866886906926946966987007027047067087107127147167187207227247267287307327347367387407427447467487507527547567587607627647667687707727747767787807827847867887907927947967988008028048068088108128148168188208228248268288308328348368388408428448468488508528548568588608628648668688708728748768788808828848868888908928948968989009029049069089109129149169189209229249269289309329349369389409429449469489509529549569589609629649669689709729749769789809829849869889909929949969981000100210041006100810101012101410161018102010221024102610281030103210341036103810401042104410461048105010521054105610581060106210641066106810701072107410761078108010821084108610881090109210941096109811001102110411061108111011121114111611181120112211241126112811301132113411361138114011421144114611481150115211541156115811601162116411661168117011721174117611781180118211841186118811901192119411961198120012021204120612081210121212141216121812201222122412261228123012321234123612381240124212441246124812501252125412561258126012621264126612681270127212741276127812801282128412861288129012921294129612981300130213041306130813101312131413161318132013221324132613281330133213341336133813401342134413461348135013521354135613581360136213641366136813701372137413761378138013821384138613881390139213941396139814001402140414061408141014121414141614181420142214241426142814301432143414361438144014421444144614481450145214541456145814601462146414661468147014721474147614781480148214841486148814901492149414961498150015021504150615081510151215141516151815201522152415261528153015321534153615381540154215441546154815501552155415561558156015621564156615681570157215741576157815801582158415861588159015921594159615981600160216041606160816101612161416161618162016221624162616281630163216341636163816401642164416461648165016521654165616581660166216641666166816701672167416761678168016821684168616881690169216941696169817001702170417061708171017121714171617181720172217241726172817301732173417361738174017421744174617481750175217541756175817601762176417661768177017721774177617781780178217841786178817901792179417961798180018021804180618081810181218141816181818201822182418261828183018321834183618381840184218441846184818501852185418561858186018621864186618681870187218741876187818801882188418861888189018921894189618981900190219041906190819101912191419161918192019221924192619281930193219341936193819401942194419461948195019521954195619581960196219641966196819701972197419761978198019821984198619881990199219941996199820002002200420062008201020122014201620182020202220242026202820302032203420362038204020422044204620482050205220542056205820602062206420662068207020722074207620782080208220842086208820902092209420962098210021022104210621082110211221142116211821202122212421262128213021322134213621382140214221442146214821502152215421562158216021622164216621682170217221742176217821802182218421862188219021922194219621982200220222042206220822102212221422162218222022222224222622282230223222342236223822402242224422462248225022522254225622582260226222642266226822702272227422762278228022822284228622882290229222942296229823002302230423062308231023122314231623182320232223242326232823302332233423362338234023422344234623482350235223542356235823602362236423662368237023722374237623782380238223842386238823902392239423962398240024022404240624082410241224142416241824202422242424262428243024322434243624382440244224442446244824502452245424562458246024622464246624682470247224742476247824802482248424862488249024922494249624982500250225042506250825102512251425162518252025222524252625282530253225342536253825402542254425462548255025522554255625582560256225642566256825702572257425762578258025822584258625882590259225942596259826002602260426062608261026122614261626182620262226242626262826302632263426362638264026422644264626482650265226542656265826602662266426662668267026722674267626782680268226842686268826902692269426962698270027022704270627082710271227142716271827202722272427262728273027322734273627382740274227442746274827502752275427562758276027622764276627682770277227742776277827802782278427862788279027922794279627982800280228042806280828102812281428162818282028222824282628282830283228342836283828402842284428462848285028522854285628582860286228642866286828702872287428762878288028822884288628882890289228942896289829002902290429062908291029122914291629182920292229242926292829302932293429362938294029422944294629482950295229542956295829602962296429662968297029722974297629782980298229842986298829902992299429962998300030023004300630083010301230143016301830203022302430263028303030323034303630383040304230443046304830503052305430563058306030623064306630683070307230743076307830803082308430863088309030923094309630983100310231043106310831103112311431163118312031223124312631283130313231343136313831403142314431463148315031523154315631583160316231643166316831703172317431763178318031823184318631883190319231943196319832003202320432063208321032123214321632183220322232243226322832303232323432363238324032423244324632483250325232543256325832603262326432663268327032723274327632783280328232843286328832903292329432963298330033023304330633083310331233143316331833203322332433263328333033323334333633383340334233443346334833503352335433563358336033623364336633683370337233743376337833803382338433863388339033923394339633983400340234043406340834103412341434163418342034223424342634283430343234343436343834403442344434463448345034523454345634583460346234643466346834703472347434763478348034823484348634883490349234943496349835003502350435063508351035123514351635183520352235243526352835303532353435363538354035423544354635483550355235543556355835603562356435663568357035723574357635783580358235843586358835903592359435963598360036023604360636083610361236143616361836203622362436263628363036323634363636383640364236443646364836503652365436563658366036623664366636683670367236743676367836803682368436863688369036923694369636983700370237043706370837103712371437163718372037223724372637283730373237343736373837403742374437463748375037523754375637583760376237643766376837703772377437763778378037823784378637883790379237943796379838003802380438063808381038123814381638183820382238243826382838303832383438363838384038423844384638483850385238543856385838603862386438663868387038723874387638783880388238843886388838903892389438963898390039023904390639083910391239143916391839203922392439263928393039323934393639383940394239443946394839503952395439563958396039623964396639683970397239743976397839803982398439863988399039923994399639984000"},{"name":"rand2","type":"double precision","value":1008}]} {"action":"C"} {"action":"B"} - {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":2},{"name":"toasted_col1","type":"text","value":null},{"name":"rand1","type":"double precision","value":0.783099223393947},{"name":"toasted_col2","type":"text","value":"0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500"},{"name":"rand2","type":"double precision","value":0.798440033104271}]} + {"action":"I","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":2},{"name":"toasted_col1","type":"text","value":null},{"name":"rand1","type":"double precision","value":2005},{"name":"toasted_col2","type":"text","value":"0001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500000100020003000400050006000700080009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400350036003700380039004000410042004300440045004600470048004900500051005200530054005500560057005800590060006100620063006400650066006700680069007000710072007300740075007600770078007900800081008200830084008500860087008800890090009100920093009400950096009700980099010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129013001310132013301340135013601370138013901400141014201430144014501460147014801490150015101520153015401550156015701580159016001610162016301640165016601670168016901700171017201730174017501760177017801790180018101820183018401850186018701880189019001910192019301940195019601970198019902000201020202030204020502060207020802090210021102120213021402150216021702180219022002210222022302240225022602270228022902300231023202330234023502360237023802390240024102420243024402450246024702480249025002510252025302540255025602570258025902600261026202630264026502660267026802690270027102720273027402750276027702780279028002810282028302840285028602870288028902900291029202930294029502960297029802990300030103020303030403050306030703080309031003110312031303140315031603170318031903200321032203230324032503260327032803290330033103320333033403350336033703380339034003410342034303440345034603470348034903500351035203530354035503560357035803590360036103620363036403650366036703680369037003710372037303740375037603770378037903800381038203830384038503860387038803890390039103920393039403950396039703980399040004010402040304040405040604070408040904100411041204130414041504160417041804190420042104220423042404250426042704280429043004310432043304340435043604370438043904400441044204430444044504460447044804490450045104520453045404550456045704580459046004610462046304640465046604670468046904700471047204730474047504760477047804790480048104820483048404850486048704880489049004910492049304940495049604970498049905000001000200030004000500060007000800090010001100120013001400150016001700180019002000210022002300240025002600270028002900300031003200330034003500360037003800390040004100420043004400450046004700480049005000510052005300540055005600570058005900600061006200630064006500660067006800690070007100720073007400750076007700780079008000810082008300840085008600870088008900900091009200930094009500960097009800990100010101020103010401050106010701080109011001110112011301140115011601170118011901200121012201230124012501260127012801290130013101320133013401350136013701380139014001410142014301440145014601470148014901500151015201530154015501560157015801590160016101620163016401650166016701680169017001710172017301740175017601770178017901800181018201830184018501860187018801890190019101920193019401950196019701980199020002010202020302040205020602070208020902100211021202130214021502160217021802190220022102220223022402250226022702280229023002310232023302340235023602370238023902400241024202430244024502460247024802490250025102520253025402550256025702580259026002610262026302640265026602670268026902700271027202730274027502760277027802790280028102820283028402850286028702880289029002910292029302940295029602970298029903000301030203030304030503060307030803090310031103120313031403150316031703180319032003210322032303240325032603270328032903300331033203330334033503360337033803390340034103420343034403450346034703480349035003510352035303540355035603570358035903600361036203630364036503660367036803690370037103720373037403750376037703780379038003810382038303840385038603870388038903900391039203930394039503960397039803990400040104020403040404050406040704080409041004110412041304140415041604170418041904200421042204230424042504260427042804290430043104320433043404350436043704380439044004410442044304440445044604470448044904500451045204530454045504560457045804590460046104620463046404650466046704680469047004710472047304740475047604770478047904800481048204830484048504860487048804890490049104920493049404950496049704980499050000010002000300040005000600070008000900100011001200130014001500160017001800190020002100220023002400250026002700280029003000310032003300340035003600370038003900400041004200430044004500460047004800490050005100520053005400550056005700580059006000610062006300640065006600670068006900700071007200730074007500760077007800790080008100820083008400850086008700880089009000910092009300940095009600970098009901000101010201030104010501060107010801090110011101120113011401150116011701180119012001210122012301240125012601270128012901300131013201330134013501360137013801390140014101420143014401450146014701480149015001510152015301540155015601570158015901600161016201630164016501660167016801690170017101720173017401750176017701780179018001810182018301840185018601870188018901900191019201930194019501960197019801990200020102020203020402050206020702080209021002110212021302140215021602170218021902200221022202230224022502260227022802290230023102320233023402350236023702380239024002410242024302440245024602470248024902500251025202530254025502560257025802590260026102620263026402650266026702680269027002710272027302740275027602770278027902800281028202830284028502860287028802890290029102920293029402950296029702980299030003010302030303040305030603070308030903100311031203130314031503160317031803190320032103220323032403250326032703280329033003310332033303340335033603370338033903400341034203430344034503460347034803490350035103520353035403550356035703580359036003610362036303640365036603670368036903700371037203730374037503760377037803790380038103820383038403850386038703880389039003910392039303940395039603970398039904000401040204030404040504060407040804090410041104120413041404150416041704180419042004210422042304240425042604270428042904300431043204330434043504360437043804390440044104420443044404450446044704480449045004510452045304540455045604570458045904600461046204630464046504660467046804690470047104720473047404750476047704780479048004810482048304840485048604870488048904900491049204930494049504960497049804990500"},{"name":"rand2","type":"double precision","value":3002}]} {"action":"C"} {"action":"B"} - {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":0.840187716763467},{"name":"rand2","type":"double precision","value":0.394382926635444}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"toasted_col1","type":"text","value":"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000"},{"name":"rand1","type":"double precision","value":11},{"name":"rand2","type":"double precision","value":1008}],"identity":[{"name":"id","type":"integer","value":1}]} {"action":"C"} {"action":"B"} - {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456},{"name":"rand2","type":"double precision","value":0.394382926635444}],"identity":[{"name":"id","type":"integer","value":1}]} + {"action":"U","schema":"public","table":"xpto","columns":[{"name":"id","type":"integer","value":1},{"name":"rand1","type":"double precision","value":123.456},{"name":"rand2","type":"double precision","value":1008}],"identity":[{"name":"id","type":"integer","value":1}]} {"action":"C"} {"action":"B"} {"action":"D","schema":"public","table":"xpto","identity":[{"name":"id","type":"integer","value":1}]} diff --git a/sql/bytea.sql b/sql/bytea.sql index ac3cb3daab74..0be9485185be 100644 --- a/sql/bytea.sql +++ b/sql/bytea.sql @@ -5,17 +5,18 @@ SET synchronous_commit = on; SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; +DROP SEQUENCE IF EXISTS xpto_rand_seq; -SELECT setseed(0); +CREATE SEQUENCE xpto_rand_seq START 11 INCREMENT 997; CREATE TABLE xpto ( id serial primary key, -rand1 float8 DEFAULT random(), +rand1 float8 DEFAULT nextval('xpto_rand_seq'), bincol bytea ); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); -INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * random()), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); +INSERT INTO xpto (bincol) SELECT decode(string_agg(to_char(round(g.i * 0.08122019), 'FM0000'), ''), 'hex') FROM generate_series(500, 5000) g(i); UPDATE xpto SET rand1 = 123.456 WHERE id = 1; DELETE FROM xpto WHERE id = 1; diff --git a/sql/toast.sql b/sql/toast.sql index 20caf4006a24..5c96a341b55c 100644 --- a/sql/toast.sql +++ b/sql/toast.sql @@ -5,14 +5,15 @@ SET synchronous_commit = on; SET extra_float_digits = 0; DROP TABLE IF EXISTS xpto; +DROP SEQUENCE IF EXISTS xpto_rand_seq; -SELECT setseed(0); +CREATE SEQUENCE xpto_rand_seq START 11 INCREMENT 997; CREATE TABLE xpto ( id serial primary key, toasted_col1 text, -rand1 float8 DEFAULT random(), +rand1 float8 DEFAULT nextval('xpto_rand_seq'), toasted_col2 text, -rand2 float8 DEFAULT random() +rand2 float8 DEFAULT nextval('xpto_rand_seq') ); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); From 7a03bb5202aa84c431119aacf0797662218ab581 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 16 Dec 2019 22:41:33 -0300 Subject: [PATCH 076/154] Improve regression test message regression test used to fail with 9.4 and 9.5. That's because message API is available in 9.6 and later. Filter out this test if the major version is 9.4 or 9.5. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c09b4b7a7566..83c17672ee22 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ MODULES = wal2json -# message test will fail for <= 9.5 REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids @@ -9,6 +8,11 @@ PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) +# message API is available in 9.6+ +ifneq (,$(findstring $(MAJORVERSION),9.4 9.5)) +REGRESS := $(filter-out message, $(REGRESS)) +endif + # make installcheck # # It can be run but you need to add the following parameters to From 77adac8b9f0a838c8f752a70731ee335bfd87069 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 17 Dec 2019 21:54:03 -0300 Subject: [PATCH 077/154] Add parameter include-origin This parameter includes replication origin. Default is false. Format version 2 adds origin information in BEGIN, COMMIT, CHANGE, and MESSAGE. In format version 1, origin is also available. Since replication origin was introduced in 9.5, 9.4 does not print origin information. --- wal2json.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/wal2json.c b/wal2json.c index a9be13ee6bbd..0ce4922d5663 100644 --- a/wal2json.c +++ b/wal2json.c @@ -39,6 +39,7 @@ typedef struct bool include_transaction; /* BEGIN and COMMIT objects (v2) */ bool include_xids; /* include transaction ids */ bool include_timestamp; /* include transaction timestamp */ + bool include_origin; /* replication origin */ bool include_schemas; /* qualify tables */ bool include_types; /* include data types */ bool include_type_oids; /* include data type oids */ @@ -181,6 +182,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_transaction = true; data->include_xids = false; data->include_timestamp = false; + data->include_origin = false; data->include_schemas = true; data->include_types = true; data->include_type_oids = false; @@ -256,6 +258,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-origin") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "include-origin argument is null"); + data->include_origin = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_origin)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-schemas") == 0) { if (elem->arg == NULL) @@ -561,6 +576,11 @@ pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->include_timestamp) appendStringInfo(ctx->out, "%s\"timestamp\":%s\"%s\",%s", data->ht, data->sp, timestamptz_to_str(txn->commit_time), data->nl); +#if PG_VERSION_NUM >= 90500 + if (data->include_origin) + appendStringInfo(ctx->out, "%s\"origin\":%s%u,%s", data->ht, data->sp, txn->origin_id, data->nl); +#endif + appendStringInfo(ctx->out, "%s\"change\":%s[", data->ht, data->sp); if (data->write_in_chunks) @@ -583,6 +603,11 @@ pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#if PG_VERSION_NUM >= 90500 + if (data->include_origin) + appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); +#endif + if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->final_lsn)); @@ -652,6 +677,11 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#if PG_VERSION_NUM >= 90500 + if (data->include_origin) + appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); +#endif + if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, commit_lsn)); @@ -1518,6 +1548,11 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#if PG_VERSION_NUM >= 90500 + if (data->include_origin) + appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); +#endif + if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); @@ -1841,6 +1876,14 @@ pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfoString(ctx->out, ",\"timestamp\":null"); } + if (data->include_origin) + { + if (transactional) + appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); + else + appendStringInfo(ctx->out, ",\"origin\":null"); + } + if (data->include_lsn) { char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, lsn)); From b93fb620b7167c2b42c348347c340ef038ce2729 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 20 Dec 2019 10:59:07 -0300 Subject: [PATCH 078/154] Support TRUNCATE command for logical decoding This feature includes TRUNCATE commands into wal2json output. It was introduced in PostgreSQL 11 which means that wal2json will support it only for this version and on. Format version 2 will output it by default. Format version 1 won't (maintain backward compatibility). (A new option will be added to select actions -- insert, update, delete, truncate -- and it should be possible to output TRUNCATE commands in version 1 too). --- Makefile | 8 +- expected/truncate.out | 82 ++++++++++++++++ sql/truncate.sql | 28 ++++++ wal2json.c | 215 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 332 insertions(+), 1 deletion(-) create mode 100644 expected/truncate.out create mode 100644 sql/truncate.sql diff --git a/Makefile b/Makefile index 83c17672ee22..ca1359d19847 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ - filtertable selecttable include_timestamp include_lsn include_xids + filtertable selecttable include_timestamp include_lsn include_xids \ + truncate PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) @@ -13,6 +14,11 @@ ifneq (,$(findstring $(MAJORVERSION),9.4 9.5)) REGRESS := $(filter-out message, $(REGRESS)) endif +# truncate API is available in 11+ +ifneq (,$(findstring $(MAJORVERSION),9.4 9.5 9.6 10)) +REGRESS := $(filter-out truncate, $(REGRESS)) +endif + # make installcheck # # It can be run but you need to add the following parameters to diff --git a/expected/truncate.out b/expected/truncate.out new file mode 100644 index 000000000000..ad5ad4db745f --- /dev/null +++ b/expected/truncate.out @@ -0,0 +1,82 @@ +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; +CREATE TABLE table_truncate_1 (a integer, b text); +CREATE TABLE table_truncate_2 (a integer, b text); +CREATE TABLE table_truncate_3 (a integer, b text); +CREATE TABLE table_truncate_4 (a integer, b text); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +TRUNCATE table_truncate_1; +BEGIN; +TRUNCATE table_truncate_2; +INSERT INTO table_truncate_1 (a, b) VALUES(1, 'test1'); +INSERT INTO table_truncate_3 (a, b) VALUES(2, 'test2'); +TRUNCATE table_truncate_3; +INSERT INTO table_truncate_3 (a, b) VALUES(3, 'test3'); +COMMIT; +BEGIN; +TRUNCATE table_truncate_4; +ROLLBACK; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); + data +------------------------------------------------------------- + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "table_truncate_1", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"],+ + "columnvalues": [1, "test1"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_truncate_3", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"],+ + "columnvalues": [2, "test2"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_truncate_3", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "text"],+ + "columnvalues": [3, "test3"] + + } + + ] + + } +(2 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_1"} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_2"} + {"action":"I","schema":"public","table":"table_truncate_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"test1"}]} + {"action":"I","schema":"public","table":"table_truncate_3","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"text","value":"test2"}]} + {"action":"T","schema":"public","table":"table_truncate_3"} + {"action":"I","schema":"public","table":"table_truncate_3","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"text","value":"test3"}]} + {"action":"C"} +(10 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/truncate.sql b/sql/truncate.sql new file mode 100644 index 000000000000..121b735f1903 --- /dev/null +++ b/sql/truncate.sql @@ -0,0 +1,28 @@ +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; + +CREATE TABLE table_truncate_1 (a integer, b text); +CREATE TABLE table_truncate_2 (a integer, b text); +CREATE TABLE table_truncate_3 (a integer, b text); +CREATE TABLE table_truncate_4 (a integer, b text); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +TRUNCATE table_truncate_1; + +BEGIN; +TRUNCATE table_truncate_2; +INSERT INTO table_truncate_1 (a, b) VALUES(1, 'test1'); +INSERT INTO table_truncate_3 (a, b) VALUES(2, 'test2'); +TRUNCATE table_truncate_3; +INSERT INTO table_truncate_3 (a, b) VALUES(3, 'test3'); +COMMIT; + +BEGIN; +TRUNCATE table_truncate_4; +ROLLBACK; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 0ce4922d5663..aa3fcc7d5e99 100644 --- a/wal2json.c +++ b/wal2json.c @@ -101,6 +101,11 @@ static void pg_decode_message(LogicalDecodingContext *ctx, bool transactional, const char *prefix, Size content_size, const char *content); #endif +#if PG_VERSION_NUM >= 110000 +static void pg_decode_truncate(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change); +#endif static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); @@ -120,6 +125,11 @@ static void pg_decode_message_v1(LogicalDecodingContext *ctx, bool transactional, const char *prefix, Size content_size, const char *content); #endif +#if PG_VERSION_NUM >= 110000 +static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change); +#endif /* version 2 */ static void pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, @@ -138,6 +148,11 @@ static void pg_decode_message_v2(LogicalDecodingContext *ctx, bool transactional, const char *prefix, Size content_size, const char *content); #endif +#if PG_VERSION_NUM >= 110000 +static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change); +#endif void _PG_init(void) @@ -158,6 +173,9 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb) #if PG_VERSION_NUM >= 90600 cb->message_cb = pg_decode_message; #endif +#if PG_VERSION_NUM >= 110000 + cb->truncate_cb = pg_decode_truncate; +#endif } /* Initialize this plugin */ @@ -1913,6 +1931,203 @@ pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } #endif +#if PG_VERSION_NUM >= 110000 +/* Callback for TRUNCATE command */ +static void pg_decode_truncate(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + if (data->format_version == 2) + pg_decode_truncate_v2(ctx, txn, n, relations, change); + else if (data->format_version == 1) + pg_decode_truncate_v1(ctx, txn, n, relations, change); + else + elog(ERROR, "format version %d is not supported", data->format_version); +} + +static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change) +{ +#ifdef _NOT_USED + JsonDecodingData *data; + MemoryContext old; + int i; + + data = ctx->output_plugin_private; + + /* Avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + if (data->write_in_chunks) + OutputPluginPrepareWrite(ctx, true); + + /* + * increment counter only for transactional messages because + * non-transactional message has only one object. + */ + data->nr_changes++; + + /* if we don't write in chunks, we need a newline here */ + if (!data->write_in_chunks) + appendStringInfo(ctx->out, "%s", data->nl); + + appendStringInfo(ctx->out, "%s%s", data->ht, data->ht); + + if (data->nr_changes > 1) + appendStringInfoChar(ctx->out, ','); + + appendStringInfo(ctx->out, "{%s%s%s%s\"kind\":%s\"truncate\",%s", data->nl, data->ht, data->ht, data->ht, data->sp, data->nl); + + if (data->include_xids) + appendStringInfo(ctx->out, "%s%s%s\"xid\":%s%u,%s", data->ht, data->ht, data->ht, data->sp, txn->xid, data->nl); + + if (data->include_timestamp) + appendStringInfo(ctx->out, "%s%s%s\"timestamp\":%s\"%s\",%s", data->ht, data->ht, data->ht, data->sp, timestamptz_to_str(txn->commit_time), data->nl); + + if (data->include_origin) + appendStringInfo(ctx->out, "%s%s%s\"origin\":%s%u,%s", data->ht, data->ht, data->ht, data->sp, txn->origin_id, data->nl); + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + appendStringInfo(ctx->out, "%s%s%s\"lsn\":%s\"%s\",%s", data->ht, data->ht, data->ht, data->sp, lsn_str, data->nl); + pfree(lsn_str); + } + + for (i = 0; i < n; i++) + { + if (data->include_schemas) + { + appendStringInfo(ctx->out, "%s%s%s\"schema\":%s", data->ht, data->ht, data->ht, data->sp); + escape_json(ctx->out, get_namespace_name(RelationGetNamespace(relations[i]))); + appendStringInfo(ctx->out, ",%s", data->nl); + } + + appendStringInfo(ctx->out, "%s%s%s\"table\":%s", data->ht, data->ht, data->ht, data->sp); + escape_json(ctx->out, RelationGetRelationName(relations[i])); + } + + appendStringInfo(ctx->out, "%s%s%s}", data->nl, data->ht, data->ht); + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + + if (data->write_in_chunks) + OutputPluginWrite(ctx, true); +#endif +} + +static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, + ReorderBufferTXN *txn, int n, Relation relations[], + ReorderBufferChange *change) +{ + JsonDecodingData *data = ctx->output_plugin_private; + MemoryContext old; + int i; + + /* avoid leaking memory by using and resetting our own context */ + old = MemoryContextSwitchTo(data->context); + + for (i = 0; i < n; i++) + { + char *schemaname; + char *tablename; + + /* schema and table names are used for chosen tables */ + schemaname = get_namespace_name(RelationGetNamespace(relations[i])); + tablename = RelationGetRelationName(relations[i]); + + /* Exclude tables, if available */ + if (list_length(data->filter_tables) > 0) + { + ListCell *lc; + + foreach(lc, data->filter_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was filtered out", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + continue; + } + } + } + } + + /* Add tables */ + if (list_length(data->add_tables) > 0) + { + ListCell *lc; + bool skip = true; + + /* all tables in all schemas are added by default */ + foreach(lc, data->add_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was added", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + skip = false; + } + } + } + + /* table was not found */ + if (skip) + continue; + } + + OutputPluginPrepareWrite(ctx, true); + appendStringInfoChar(ctx->out, '{'); + appendStringInfoString(ctx->out, "\"action\":\"T\""); + + if (data->include_xids) + appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); + + if (data->include_origin) + appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); + + if (data->include_lsn) + { + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); + pfree(lsn_str); + } + + if (data->include_schemas) + { + appendStringInfo(ctx->out, ",\"schema\":"); + escape_json(ctx->out, schemaname); + } + + appendStringInfo(ctx->out, ",\"table\":"); + escape_json(ctx->out, tablename); + + appendStringInfoChar(ctx->out, '}'); + OutputPluginWrite(ctx, true); + } + + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); +} +#endif + static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables) { From aa431a97643aaf3e27b46fb3efd2100b8888a442 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 20 Dec 2019 16:02:27 -0300 Subject: [PATCH 079/154] Option actions This new feature let users select actions they want to receive. Actions supported are insert, update, delete, and truncate. This actions are similar to PUBLICATION command. Format version 1 won't enable truncate by default (to maintain backward compatibility). Format version 2 will enable all options by default. A new test was added (run only on Postgres v11 or later). That's because test includes truncate and it will only supported by v11 or later. --- Makefile | 8 ++- README.md | 1 + expected/actions.out | 133 +++++++++++++++++++++++++++++++++++++++++++ sql/actions.sql | 23 ++++++++ wal2json.c | 123 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 expected/actions.out create mode 100644 sql/actions.sql diff --git a/Makefile b/Makefile index ca1359d19847..f5f8fda81205 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - truncate + truncate actions PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) @@ -19,6 +19,12 @@ ifneq (,$(findstring $(MAJORVERSION),9.4 9.5 9.6 10)) REGRESS := $(filter-out truncate, $(REGRESS)) endif +# actions API is available in 11+ +# this test should be executed in prior versions, however, truncate will fail. +ifneq (,$(findstring $(MAJORVERSION),9.4 9.5 9.6 10)) +REGRESS := $(filter-out actions, $(REGRESS)) +endif + # make installcheck # # It can be run but you need to add the following parameters to diff --git a/README.md b/README.md index 22f749a860ef..c63803bb0032 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Parameters * `filter-msg-prefixes`: exclude messages if prefix is in the list. Default is empty which means that no message will be filtered. It is a comma separated value. * `add-msg-prefixes`: include only messages if prefix is in the list. Default is all prefixes. It is a comma separated value. `wal2json` applies `filter-msg-prefixes` before this parameter. * `format-version`: defines which format to use. Default is _1_. +* `actions`: define which operations will be sent. Default is all actions (insert, update, delete, and truncate). However, if you are using `format-version` 1, truncate is not enabled (backward compatibility). Examples ======== diff --git a/expected/actions.out b/expected/actions.out new file mode 100644 index 000000000000..da2a95d1fdaa --- /dev/null +++ b/expected/actions.out @@ -0,0 +1,133 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +-- actions +CREATE TABLE actions (a integer primary key); +INSERT INTO actions (a) VALUES(1); +UPDATE actions SET a = 2 WHERE a = 1; +DELETE FROM actions WHERE a = 2; +TRUNCATE TABLE actions; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'insert, foo, delete'); +ERROR: could not parse value "foo" for parameter "actions" +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"actions","columnnames":["a"],"columntypes":["integer"],"columnvalues":[1]}]} + {"change":[{"kind":"update","schema":"public","table":"actions","columnnames":["a"],"columntypes":["integer"],"columnvalues":[2],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[{"kind":"delete","schema":"public","table":"actions","oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[2]}}]} + {"change":[]} +(5 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"actions","columns":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"actions","columns":[{"name":"a","type":"integer","value":2}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"actions","identity":[{"name":"a","type":"integer","value":2}]} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"actions"} + {"action":"C"} +(14 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'insert'); + data +-------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"actions","columns":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(11 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'update'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"actions","columns":[{"name":"a","type":"integer","value":2}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(11 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'delete'); + data +--------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"actions","identity":[{"name":"a","type":"integer","value":2}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} +(11 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'truncate'); + data +---------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"actions"} + {"action":"C"} +(11 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'update, truncate'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"actions","columns":[{"name":"a","type":"integer","value":2}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"actions"} + {"action":"C"} +(12 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/actions.sql b/sql/actions.sql new file mode 100644 index 000000000000..86745e8d682c --- /dev/null +++ b/sql/actions.sql @@ -0,0 +1,23 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +-- actions +CREATE TABLE actions (a integer primary key); +INSERT INTO actions (a) VALUES(1); +UPDATE actions SET a = 2 WHERE a = 1; +DELETE FROM actions WHERE a = 2; +TRUNCATE TABLE actions; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'insert, foo, delete'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'insert'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'update'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'delete'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'truncate'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'actions', 'update, truncate'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index aa3fcc7d5e99..aea7db0e64c9 100644 --- a/wal2json.c +++ b/wal2json.c @@ -33,6 +33,14 @@ PG_MODULE_MAGIC; extern void _PG_init(void); extern void PGDLLEXPORT _PG_output_plugin_init(OutputPluginCallbacks *cb); +typedef struct +{ + bool insert; + bool update; + bool delete; + bool truncate; +} JsonAction; + typedef struct { MemoryContext context; @@ -49,6 +57,8 @@ typedef struct bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ + JsonAction actions; /* output only these actions */ + List *filter_tables; /* filter out tables */ List *add_tables; /* add only these tables */ List *filter_msg_prefixes; /* filter by message prefixes */ @@ -215,6 +225,22 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->format_version = WAL2JSON_FORMAT_VERSION; + /* default actions */ + if (WAL2JSON_FORMAT_VERSION == 1) + { + data->actions.insert = true; + data->actions.update = true; + data->actions.delete = true; + data->actions.truncate = false; /* backward compatibility */ + } + else + { + data->actions.insert = true; + data->actions.update = true; + data->actions.delete = true; + data->actions.truncate = true; + } + /* pretty print */ strcpy(data->ht, ""); strcpy(data->nl, ""); @@ -406,6 +432,58 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is (errcode(ERRCODE_INVALID_NAME), errmsg("parameter \"%s\" was deprecated", elem->defname))); } + else if (strcmp(elem->defname, "actions") == 0) + { + char *rawstr; + + if (elem->arg == NULL) + { + elog(DEBUG1, "actions argument is null"); + /* argument null means default; nothing to do here */ + } + else + { + List *selected_actions = NIL; + ListCell *lc; + + rawstr = pstrdup(strVal(elem->arg)); + if (!split_string_to_list(rawstr, ',', &selected_actions)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + + data->actions.insert = false; + data->actions.update = false; + data->actions.delete = false; + data->actions.truncate = false; + + foreach(lc, selected_actions) + { + char *p = lfirst(lc); + + if (strcmp(p, "insert") == 0) + data->actions.insert = true; + else if (strcmp(p, "update") == 0) + data->actions.update = true; + else if (strcmp(p, "delete") == 0) + data->actions.delete = true; + else if (strcmp(p, "truncate") == 0) + data->actions.truncate = true; + else + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + p, elem->defname))); + } + + pfree(rawstr); + list_free(selected_actions); + } + } else if (strcmp(elem->defname, "filter-tables") == 0) { char *rawstr; @@ -1042,6 +1120,23 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, AssertVariableIsOfType(&pg_decode_change, LogicalDecodeChangeCB); data = ctx->output_plugin_private; + + if (!data->actions.insert) + { + elog(DEBUG3, "ignore INSERT"); + return; + } + if (!data->actions.update) + { + elog(DEBUG3, "ignore UPDATE"); + return; + } + if (!data->actions.delete) + { + elog(DEBUG3, "ignore DELETE"); + return; + } + class_form = RelationGetForm(relation); tupdesc = RelationGetDescr(relation); @@ -1668,6 +1763,22 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, char *schemaname; char *tablename; + if (change->action == REORDER_BUFFER_CHANGE_INSERT && !data->actions.insert) + { + elog(DEBUG3, "ignore INSERT"); + return; + } + if (change->action == REORDER_BUFFER_CHANGE_UPDATE && !data->actions.update) + { + elog(DEBUG3, "ignore UPDATE"); + return; + } + if (change->action == REORDER_BUFFER_CHANGE_DELETE && !data->actions.delete) + { + elog(DEBUG3, "ignore DELETE"); + return; + } + /* avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); @@ -1958,6 +2069,12 @@ static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, data = ctx->output_plugin_private; + if (!data->actions.truncate) + { + elog(DEBUG3, "ignore TRUNCATE"); + return; + } + /* Avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); @@ -2028,6 +2145,12 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, MemoryContext old; int i; + if (!data->actions.truncate) + { + elog(DEBUG3, "ignore TRUNCATE"); + return; + } + /* avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); From 3909a51f5089be1fbd0a315e47743db61ea66be6 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 20 Dec 2019 16:30:20 -0300 Subject: [PATCH 080/154] Adjust default format version Format version 1 will still remain the default version. wal2json does not require a format version until a few commits ago (with no new version released) and use a new format version will break calls that does not inform format-version parameter. Let's give some time to users adopt format-version parameter. --- README.md | 4 +++- wal2json.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c63803bb0032..4b0946da48a1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ Introduction **wal2json** is an output plugin for logical decoding. It means that the plugin have access to tuples produced by INSERT and UPDATE. Also, UPDATE/DELETE old row versions can be accessed depending on the configured replica identity. Changes can be consumed using the streaming protocol (logical replication slots) or by a special SQL API. -The **wal2json** output plugin produces a JSON object per transaction. All of the new/old tuples are available in the JSON object. Also, there are options to include properties such as transaction timestamp, schema-qualified, data types, and transaction ids. +**format version 1** produces a JSON object per transaction. All of the new/old tuples are available in the JSON object. Also, there are options to include properties such as transaction timestamp, schema-qualified, data types, and transaction ids. + +**format version 2** produces a JSON object per tuple. Optional JSON object for beginning and end of transaction. Also, there are a variety of options to include properties. **wal2json** is released under PostgreSQL license. diff --git a/wal2json.c b/wal2json.c index aea7db0e64c9..77b4cc36a931 100644 --- a/wal2json.c +++ b/wal2json.c @@ -223,7 +223,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->filter_msg_prefixes = NIL; data->add_msg_prefixes = NIL; - data->format_version = WAL2JSON_FORMAT_VERSION; + data->format_version = 1; /* default actions */ if (WAL2JSON_FORMAT_VERSION == 1) From 6a188aea653d32eaecdc09c824f492769d7dfbf9 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 29 Dec 2019 10:10:14 -0300 Subject: [PATCH 081/154] format-version 2 example This new example shows the output for format-version 2. --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index 4b0946da48a1..f0abed0bf1ed 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,57 @@ psql:/tmp/example2.sql:17: WARNING: table "table2_without_pk" without primary k stop ``` +Let's repeat the same example with `format-version` 2: + +``` +$ cat /tmp/example3.sql +CREATE TABLE table2_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table2_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); + +SELECT 'init' FROM pg_create_logical_replication_slot('test_slot', 'wal2json'); + +BEGIN; +INSERT INTO table2_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table2_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table2_with_pk (b, c) VALUES('Replication', now()); +DELETE FROM table2_with_pk WHERE a < 3; + +INSERT INTO table2_without_pk (b, c) VALUES(2.34, 'Tapir'); +-- it is not added to stream because there isn't a pk or a replica identity +UPDATE table2_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +COMMIT; + +SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'format-version', '2'); +SELECT 'stop' FROM pg_drop_replication_slot('test_slot'); +``` + +The script above produces the output below: + +``` +$ psql -At -f /tmp/example3.sql postgres +CREATE TABLE +CREATE TABLE +init +BEGIN +INSERT 0 1 +INSERT 0 1 +INSERT 0 1 +DELETE 2 +INSERT 0 1 +UPDATE 1 +COMMIT +psql:/tmp/example3.sql:17: WARNING: no tuple identifier for UPDATE in table "public"."table2_without_pk" +{"action":"B"} +{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"character varying(30)","value":"Backup and Restore"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"character varying(30)","value":"Tuning"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"character varying(30)","value":"Replication"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"D","schema":"public","table":"table2_with_pk","identity":[{"name":"a","type":"integer","value":1},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"D","schema":"public","table":"table2_with_pk","identity":[{"name":"a","type":"integer","value":2},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table2_without_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"numeric(5,2)","value":2.34},{"name":"c","type":"text","value":"Tapir"}]} +{"action":"C"} +stop +``` + License ======= From ff20f8d90b00e9d4fba468fa115f109303c80541 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 3 Jan 2020 11:23:41 -0300 Subject: [PATCH 082/154] Fix license oversight The wal2json license is BSD 3-clause, however, there is a sentence in the README that says it is released under PostgreSQL license (it is not). This is an oversight in the commit 0b653ee46bb75fd5301277bca56a1dce8a60ffb6. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index f0abed0bf1ed..09414549d15c 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ Introduction **format version 2** produces a JSON object per tuple. Optional JSON object for beginning and end of transaction. Also, there are a variety of options to include properties. -**wal2json** is released under PostgreSQL license. - Requirements ============ From 2f1bead54a638acdc207680ba79c2d393dbbdf20 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 3 Jan 2020 11:33:46 -0300 Subject: [PATCH 083/154] Update copyright --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 9e92c789a534..4e12addd400f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2019, Euler Taveira de Oliveira +Copyright (c) 2013-2020, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index 09414549d15c..b469c717ac97 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ stop License ======= -> Copyright (c) 2013-2019, Euler Taveira de Oliveira +> Copyright (c) 2013-2020, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index 77b4cc36a931..9d1edc83a60e 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2019, Euler Taveira de Oliveira + * Copyright (c) 2013-2020, Euler Taveira de Oliveira * * IDENTIFICATION * contrib/wal2json/wal2json.c From 33a272b205403d37ccad566412baf914c3559429 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Fri, 3 Jan 2020 13:59:41 -0300 Subject: [PATCH 084/154] Adjust instructions Use default max_replication_slots value as suggestion for examples / tests. --- Makefile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f5f8fda81205..eee3ddb4cbe3 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,6 @@ endif # postgresql.conf: # # wal_level = logical -# max_replication_slots = 4 +# max_replication_slots = 10 # # Also, you should start the server before executing it. diff --git a/README.md b/README.md index b469c717ac97..d084e8f7a9a5 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ You need to set up at least two parameters at postgresql.conf: ``` wal_level = logical -max_replication_slots = 1 +max_replication_slots = 10 ``` After changing these parameters, a restart is needed. From ba214caa14f8ece707f6a436cf6299aa73a2bcac Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 8 Feb 2020 09:02:24 -0300 Subject: [PATCH 085/154] Fix oversight in option actions This oversight was introduced in commit aa431a97643aaf3e27b46fb3efd2100b8888a442. Issue #148 reported by @dko-slapdash. --- wal2json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wal2json.c b/wal2json.c index 9d1edc83a60e..0ba3c0e59c04 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1121,17 +1121,17 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, data = ctx->output_plugin_private; - if (!data->actions.insert) + if (change->action == REORDER_BUFFER_CHANGE_INSERT && !data->actions.insert) { elog(DEBUG3, "ignore INSERT"); return; } - if (!data->actions.update) + if (change->action == REORDER_BUFFER_CHANGE_UPDATE && !data->actions.update) { elog(DEBUG3, "ignore UPDATE"); return; } - if (!data->actions.delete) + if (change->action == REORDER_BUFFER_CHANGE_DELETE && !data->actions.delete) { elog(DEBUG3, "ignore DELETE"); return; From fbf9505e6e2fca6003ab26009c4999a8fe66d340 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 8 Feb 2020 09:35:54 -0300 Subject: [PATCH 086/154] Fix memory leak while using add-tables and filter-tables This issue was reported in PR #147 by @haizz. The proposed fix was incomplete (as I pointed out) and I fixed add-tables option and also format 2 (add-tables and filter-tables). --- wal2json.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/wal2json.c b/wal2json.c index 0ba3c0e59c04..4213ac2a6f41 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1157,6 +1157,7 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (list_length(data->filter_tables) > 0) { ListCell *lc; + bool skip = false; foreach(lc, data->filter_tables) { @@ -1169,10 +1170,18 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, elog(DEBUG2, "\"%s\".\"%s\" was filtered out", ((t->allschemas) ? "*" : t->schemaname), ((t->alltables) ? "*" : t->tablename)); - return; + skip = true; } } } + + /* table was found */ + if (skip) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; + } } /* Add tables */ @@ -1200,7 +1209,11 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* table was not found */ if (skip) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; + } } /* Sanity checks */ @@ -1790,6 +1803,7 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (list_length(data->filter_tables) > 0) { ListCell *lc; + bool skip = false; foreach(lc, data->filter_tables) { @@ -1802,10 +1816,18 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, elog(DEBUG2, "\"%s\".\"%s\" was filtered out", ((t->allschemas) ? "*" : t->schemaname), ((t->alltables) ? "*" : t->tablename)); - return; + skip = true; } } } + + /* table was found */ + if (skip) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; + } } /* Add tables */ @@ -1833,7 +1855,11 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, /* table was not found */ if (skip) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); return; + } } pg_decode_write_change(ctx, txn, relation, change); From 695696d7165683bbeae6833a44faa9fb28bae21e Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 9 Feb 2020 12:25:43 -0300 Subject: [PATCH 087/154] Fix segfault on 32 bits I forgot to pass a Datum and I'm surprised it haven't crashed yet. This commit fixes issue #142. Reported by @df7cb and confirmed by @cpaelzer. --- wal2json.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wal2json.c b/wal2json.c index 4213ac2a6f41..3624781b4500 100644 --- a/wal2json.c +++ b/wal2json.c @@ -662,7 +662,7 @@ pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->end_lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(txn->end_lsn))); appendStringInfo(ctx->out, "%s\"nextlsn\":%s\"%s\",%s", data->ht, data->sp, lsn_str, data->nl); @@ -706,7 +706,7 @@ pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, txn->final_lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(txn->final_lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); } @@ -780,7 +780,7 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, commit_lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(commit_lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); } @@ -1681,7 +1681,7 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(change->lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); } @@ -2041,7 +2041,7 @@ pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); } @@ -2135,7 +2135,7 @@ static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(change->lsn))); appendStringInfo(ctx->out, "%s%s%s\"lsn\":%s\"%s\",%s", data->ht, data->ht, data->ht, data->sp, lsn_str, data->nl); pfree(lsn_str); } @@ -2254,7 +2254,7 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, if (data->include_lsn) { - char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, change->lsn)); + char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(change->lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); } From 9b8bbde3e67e4baca0de4db535d724a7316e1bda Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 9 Feb 2020 12:33:20 -0300 Subject: [PATCH 088/154] Use correct format specifier uint64 should use UINT64_FORMAT instead of %lu because format specifier depends on a type probe. It suppresses a compiler warning. --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 3624781b4500..be170bf2f52d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -740,7 +740,7 @@ pg_decode_commit_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, elog(DEBUG2, "txn has catalog changes: yes"); else elog(DEBUG2, "txn has catalog changes: no"); - elog(DEBUG2, "my change counter: %lu ; # of changes: %lu ; # of changes in memory: %lu", data->nr_changes, txn->nentries, txn->nentries_mem); + elog(DEBUG2, "my change counter: " UINT64_FORMAT " ; # of changes: " UINT64_FORMAT " ; # of changes in memory: " UINT64_FORMAT, data->nr_changes, txn->nentries, txn->nentries_mem); elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); /* Transaction ends */ From 84869ea8c1bc0757cfbcb3897080809cb86301e7 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 10 Feb 2020 17:31:24 -0300 Subject: [PATCH 089/154] Move some debug code for general function Some debug messages were only printed if we are using format 1, let's move them to general function. --- wal2json.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wal2json.c b/wal2json.c index be170bf2f52d..50469cf0d0fd 100644 --- a/wal2json.c +++ b/wal2json.c @@ -722,6 +722,13 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; + if (txn->has_catalog_changes) + elog(DEBUG2, "txn has catalog changes: yes"); + else + elog(DEBUG2, "txn has catalog changes: no"); + elog(DEBUG2, "my change counter: " UINT64_FORMAT " ; # of changes: " UINT64_FORMAT " ; # of changes in memory: " UINT64_FORMAT, data->nr_changes, txn->nentries, txn->nentries_mem); + elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); + if (data->format_version == 2) pg_decode_commit_txn_v2(ctx, txn, commit_lsn); else if (data->format_version == 1) @@ -736,13 +743,6 @@ pg_decode_commit_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; - if (txn->has_catalog_changes) - elog(DEBUG2, "txn has catalog changes: yes"); - else - elog(DEBUG2, "txn has catalog changes: no"); - elog(DEBUG2, "my change counter: " UINT64_FORMAT " ; # of changes: " UINT64_FORMAT " ; # of changes in memory: " UINT64_FORMAT, data->nr_changes, txn->nentries, txn->nentries_mem); - elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); - /* Transaction ends */ if (data->write_in_chunks) OutputPluginPrepareWrite(ctx, true); From 9f9762315062888f7f7f4f0a115073a33ad1275e Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 10 Feb 2020 17:57:04 -0300 Subject: [PATCH 090/154] Add macro for backward compatibility UInt64GetDatum was introduced in 9.6. I forgot to test old stable versions and didn't get it. Fortunately, @df7cb reported it. --- wal2json.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wal2json.c b/wal2json.c index 50469cf0d0fd..d754916e6be2 100644 --- a/wal2json.c +++ b/wal2json.c @@ -164,6 +164,19 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, ReorderBufferChange *change); #endif +/* + * Backward compatibility. + * + * This macro is only available in 9.6+. + */ +#if PG_VERSION_NUM < 90600 +#ifdef USE_FLOAT8_BYVAL +#define UInt64GetDatum(X) ((Datum) (X)) +#else +#define UInt64GetDatum(X) Int64GetDatum((int64) (X)) +#endif +#endif + void _PG_init(void) { From e33df9414b86d094d811cf77b83dc3d26d9f11ce Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 17 Feb 2020 22:53:09 -0300 Subject: [PATCH 091/154] Add parameter include-domain-data-type This parameter replaces domain name with its underlying data type. Default is false (backward compatibility). Both formats (1 and 2) are supported. It is useful if you want to expose the "real" data type. --- Makefile | 2 +- README.md | 1 + sql/include_domain_data_type.sql | 50 ++++++++++++++++++++ wal2json.c | 78 +++++++++++++++++++++++++++----- 4 files changed, 119 insertions(+), 12 deletions(-) create mode 100644 sql/include_domain_data_type.sql diff --git a/Makefile b/Makefile index eee3ddb4cbe3..aeb7bfdd8a1b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - truncate actions + include_domain_data_type truncate actions PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/README.md b/README.md index d084e8f7a9a5..8617394321c4 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ Parameters * `include-types`: add _type_ to each change. Default is _true_. * `include-typmod`: add modifier to types that have it (eg. varchar(20) instead of varchar). Default is _true_. * `include-type-oids`: add type oids. Default is _false_. +* `include-domain-data-type`: replace domain name with the underlying data type. Default is _false_. * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. diff --git a/sql/include_domain_data_type.sql b/sql/include_domain_data_type.sql new file mode 100644 index 000000000000..6d63309c0e88 --- /dev/null +++ b/sql/include_domain_data_type.sql @@ -0,0 +1,50 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; + +CREATE DOMAIN wal2json_domain_1 AS bigint; +CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); +CREATE DOMAIN wal2json_domain_3 AS varchar(30); +CREATE DOMAIN wal2json_domain_4 AS bit varying(20); + +CREATE TABLE test_wal2json_5 ( +a smallserial, +b smallint, +c int, +d wal2json_domain_1, +e wal2json_domain_2, +f real not null, +g double precision, +h char(10), +i wal2json_domain_3, +j text, +k wal2json_domain_4, +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); + +UPDATE test_wal2json_5 SET f = -f WHERE b = 1; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-typmod', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE test_wal2json_5; +DROP DOMAIN wal2json_domain_1; +DROP DOMAIN wal2json_domain_2; +DROP DOMAIN wal2json_domain_3; +DROP DOMAIN wal2json_domain_4; diff --git a/wal2json.c b/wal2json.c index d754916e6be2..fbf41c3c045d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -52,6 +52,7 @@ typedef struct bool include_types; /* include data types */ bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ + bool include_domain_data_type; /* include underlying data type of the domain */ bool include_not_null; /* include not-null constraints */ bool pretty_print; /* pretty-print JSON? */ @@ -228,6 +229,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_types = true; data->include_type_oids = false; data->include_typmod = true; + data->include_domain_data_type = false; data->pretty_print = false; data->write_in_chunks = false; data->include_lsn = false; @@ -380,6 +382,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-domain-data-type") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "include-types argument is null"); + data->include_domain_data_type = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_domain_data_type)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-not-null") == 0) { if (elem->arg == NULL) @@ -944,22 +959,47 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (data->include_types) { - if (data->include_typmod) - { - char *type_str; + char *type_str; + Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); - type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); - appendStringInfo(&coltypes, "%s", comma); - escape_json(&coltypes, type_str); - pfree(type_str); + /* + * It is a domain. Replace domain name with base data type if + * include_domain_data_type is enabled. + */ + if (type_form->typtype == TYPTYPE_DOMAIN && data->include_domain_data_type) + { + typid = type_form->typbasetype; + if (data->include_typmod) + { + getTypeOutputInfo(typid, &typoutput, &typisvarlena); + type_str = format_type_with_typemod(type_form->typbasetype, type_form->typtypmod); + } + else + { + /* + * Since we are not using a format function, grab base type + * name from Form_pg_type. + */ + type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (!HeapTupleIsValid(type_tuple)) + elog(ERROR, "cache lookup failed for type %u", typid); + type_form = (Form_pg_type) GETSTRUCT(type_tuple); + type_str = pstrdup(NameStr(type_form->typname)); + } } else { - Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); - appendStringInfo(&coltypes, "%s", comma); - escape_json(&coltypes, NameStr(type_form->typname)); + if (data->include_typmod) + type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); + else + type_str = pstrdup(NameStr(type_form->typname)); } + appendStringInfo(&coltypes, "%s", comma); + escape_json(&coltypes, type_str); + + pfree(type_str); + /* oldkeys doesn't print not-null constraints */ if (!replident && data->include_not_null) { @@ -1587,10 +1627,26 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple /* type name (with typmod, if available) */ if (data->include_types) { - type_str = format_type_with_typemod(attr->atttypid, attr->atttypmod); + HeapTuple type_tuple; + Form_pg_type type_form; + + type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(attr->atttypid)); + type_form = (Form_pg_type) GETSTRUCT(type_tuple); + + /* + * It is a domain. Replace domain name with base data type if + * include_domain_data_type is enabled. + */ + if (type_form->typtype == TYPTYPE_DOMAIN && data->include_domain_data_type) + type_str = format_type_with_typemod(type_form->typbasetype, type_form->typtypmod); + else + type_str = format_type_with_typemod(attr->atttypid, attr->atttypmod); + appendStringInfoString(ctx->out, ",\"type\":"); appendStringInfo(ctx->out, "\"%s\"", type_str); pfree(type_str); + + ReleaseSysCache(type_tuple); } appendStringInfoString(ctx->out, ",\"value\":"); From a85b72872389984b3b1cca22f4aae8513e200e2b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 18 Feb 2020 16:50:20 -0300 Subject: [PATCH 092/154] struct ReorderBufferTXN changed Some struct members (including has_catalog_changes) was turned into a single variable since v13 (cf postgres commit a7b6ab5db1d35438112f74f3531354ddd61970b5). --- wal2json.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wal2json.c b/wal2json.c index fbf41c3c045d..314bff72791c 100644 --- a/wal2json.c +++ b/wal2json.c @@ -750,7 +750,11 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; +#if PG_VERSION_NUM >= 130000 + if (rbtxn_has_catalog_changes(txn)) +#else if (txn->has_catalog_changes) +#endif elog(DEBUG2, "txn has catalog changes: yes"); else elog(DEBUG2, "txn has catalog changes: no"); From 0d1fb8c0fed63da8fdb1f3c0e0579b35a5ef7a6a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 23 Feb 2020 22:38:57 -0300 Subject: [PATCH 093/154] Rephrase include-unchanged-toast docs This parameter was deprecated some time ago. However, its description is confusing users. Let's add a blink alert to NOT use it. It will eventually be removed. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8617394321c4..0034cb18a620 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Parameters * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. -* `include-unchanged-toast` (deprecated): add TOAST value even if it was not modified. Since TOAST values are usually large, this option could save IO and bandwidth if it is disabled. Default is _true_. +* `include-unchanged-toast` (deprecated): Don't use it. It is deprecated. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. * `filter-msg-prefixes`: exclude messages if prefix is in the list. Default is empty which means that no message will be filtered. It is a comma separated value. From 5dc477d92c9f8b63c494aa358a597f1c9864961d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 23 Feb 2020 23:46:30 -0300 Subject: [PATCH 094/154] Add expected file for parameter include-domain-data-type Commit e33df9414b86d094d811cf77b83dc3d26d9f11ce forgot to add expected file. --- expected/include_domain_data_type.out | 204 ++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 expected/include_domain_data_type.out diff --git a/expected/include_domain_data_type.out b/expected/include_domain_data_type.out new file mode 100644 index 000000000000..c738fb4e3ca6 --- /dev/null +++ b/expected/include_domain_data_type.out @@ -0,0 +1,204 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; +CREATE DOMAIN wal2json_domain_1 AS bigint; +CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); +CREATE DOMAIN wal2json_domain_3 AS varchar(30); +CREATE DOMAIN wal2json_domain_4 AS bit varying(20); +CREATE TABLE test_wal2json_5 ( +a smallserial, +b smallint, +c int, +d wal2json_domain_1, +e wal2json_domain_2, +f real not null, +g double precision, +h char(10), +i wal2json_domain_3, +j text, +k wal2json_domain_4, +l timestamp, +m date, +n boolean not null, +o json, +p tsvector, +PRIMARY KEY(b, c, d) +); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); +UPDATE test_wal2json_5 SET f = -f WHERE b = 1; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "wal2json_domain_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, "3", "3.540", 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "wal2json_domain_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, "3", "3.540", -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["smallint", "integer", "wal2json_domain_1"], + + "keyvalues": [1, 2, "3"] + + } + + } + + ] + + } +(2 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["smallint", "integer", "bigint"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } +(2 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-typmod', '0'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "wal2json_domain_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp", "date", "bool", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, "3", "3.540", 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "wal2json_domain_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp", "date", "bool", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, "3", "3.540", -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "wal2json_domain_1"], + + "keyvalues": [1, 2, "3"] + + } + + } + + ] + + } +(2 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-typmod', '0'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "test_wal2json_5", + + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + + "columntypes": ["int2", "int2", "int4", "int8", "numeric", "float4", "float8", "bpchar", "varchar", "text", "varbit", "timestamp", "date", "bool", "json", "tsvector"], + + "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"],+ + "oldkeys": { + + "keynames": ["b", "c", "d"], + + "keytypes": ["int2", "int4", "int8"], + + "keyvalues": [1, 2, 3] + + } + + } + + ] + + } +(2 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_domain_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_domain_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"}]} + {"action":"C"} +(6 rows) + +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"}]} + {"action":"C"} +(6 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE test_wal2json_5; +DROP DOMAIN wal2json_domain_1; +DROP DOMAIN wal2json_domain_2; +DROP DOMAIN wal2json_domain_3; +DROP DOMAIN wal2json_domain_4; From 9b579240ec8735e762920bdeff8ca02e201bfa03 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 23 Feb 2020 23:40:00 -0300 Subject: [PATCH 095/154] Add parameter filter-origins This parameter is useful in multidirectional replication solutions. It can prevent replicating some data back and forth. Although, each transaction has origin information, filter using this callback is more efficient. This callback is available in 9.5+. --- README.md | 1 + expected/cmdline.out | 5 ++ sql/cmdline.sql | 2 + wal2json.c | 125 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 133 insertions(+) diff --git a/README.md b/README.md index 0034cb18a620..5b820217fe71 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Parameters * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. * `include-unchanged-toast` (deprecated): Don't use it. It is deprecated. +* `filter-origins`: exclude changes from the specified origins. Default is empty which means that no origin will be filtered. It is a comma separated value. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. * `add-tables`: include only rows from the specified tables. Default is all tables from all schemas. It has the same rules from `filter-tables`. * `filter-msg-prefixes`: exclude messages if prefix is in the list. Default is empty which means that no message will be filtered. It is a comma separated value. diff --git a/expected/cmdline.out b/expected/cmdline.out index 1596c7aa3190..3cbe0cfdc150 100644 --- a/expected/cmdline.out +++ b/expected/cmdline.out @@ -11,6 +11,11 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'for ERROR: option "nosuchopt" = "42" is unknown SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-unchanged-toast', '1'); ERROR: parameter "include-unchanged-toast" was deprecated +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'filter-origins', '16, 27, 123'); + data +------ +(0 rows) + -- don't include not-null constraint by default CREATE TABLE table_optional ( a smallserial, diff --git a/sql/cmdline.sql b/sql/cmdline.sql index 58722c63b2df..7cc4ace134f1 100644 --- a/sql/cmdline.sql +++ b/sql/cmdline.sql @@ -9,6 +9,8 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'for SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-unchanged-toast', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'filter-origins', '16, 27, 123'); + -- don't include not-null constraint by default CREATE TABLE table_optional ( a smallserial, diff --git a/wal2json.c b/wal2json.c index 314bff72791c..28d6c13f4307 100644 --- a/wal2json.c +++ b/wal2json.c @@ -15,6 +15,9 @@ #include "catalog/pg_type.h" #include "replication/logical.h" +#if PG_VERSION_NUM >= 90500 +#include "replication/origin.h" +#endif #include "utils/builtins.h" #include "utils/guc.h" @@ -60,6 +63,7 @@ typedef struct JsonAction actions; /* output only these actions */ + List *filter_origins; /* filter out origins */ List *filter_tables; /* filter out tables */ List *add_tables; /* add only these tables */ List *filter_msg_prefixes; /* filter by message prefixes */ @@ -106,6 +110,9 @@ static void pg_decode_commit_txn(LogicalDecodingContext *ctx, static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); +#if PG_VERSION_NUM >= 90500 +static bool pg_filter_by_origin(LogicalDecodingContext *ctx, RepOriginId origin_id); +#endif #if PG_VERSION_NUM >= 90600 static void pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr lsn, @@ -121,6 +128,7 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); static bool split_string_to_list(char *rawstring, char separator, List **sl); +static bool split_string_to_oid_list(char *rawstring, char separator, List **sl); /* version 1 */ static void pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, @@ -194,6 +202,9 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb) cb->change_cb = pg_decode_change; cb->commit_cb = pg_decode_commit_txn; cb->shutdown_cb = pg_decode_shutdown; +#if PG_VERSION_NUM >= 90500 + cb->filter_by_origin_cb = pg_filter_by_origin; +#endif #if PG_VERSION_NUM >= 90600 cb->message_cb = pg_decode_message; #endif @@ -234,6 +245,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->write_in_chunks = false; data->include_lsn = false; data->include_not_null = false; + data->filter_origins = NIL; data->filter_tables = NIL; data->filter_msg_prefixes = NIL; data->add_msg_prefixes = NIL; @@ -512,6 +524,29 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is list_free(selected_actions); } } + else if (strcmp(elem->defname, "filter-origins") == 0) + { + char *rawstr; + + if (elem->arg == NULL) + { + elog(DEBUG1, "filter-origins argument is null"); + data->filter_origins = NIL; + } + else + { + rawstr = pstrdup(strVal(elem->arg)); + if (!split_string_to_oid_list(rawstr, ',', &data->filter_origins)) + { + pfree(rawstr); + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } + pfree(rawstr); + } + } else if (strcmp(elem->defname, "filter-tables") == 0) { char *rawstr; @@ -659,6 +694,33 @@ pg_decode_shutdown(LogicalDecodingContext *ctx) MemoryContextDelete(data->context); } +#if PG_VERSION_NUM >= 90500 +static bool +pg_filter_by_origin(LogicalDecodingContext *ctx, RepOriginId origin_id) +{ + JsonDecodingData *data = ctx->output_plugin_private; + + elog(DEBUG3, "origin: %u", origin_id); + + /* changes produced locally are never filtered */ + if (origin_id == InvalidRepOriginId) + return false; + + /* Filter origins, if available */ + if (list_length(data->filter_origins) > 0 && list_member_oid(data->filter_origins, origin_id)) + { + elog(DEBUG2, "origin \"%u\" was filtered out", origin_id); + return true; + } + + /* + * There isn't a list of origins to filter or origin is not contained in + * the filter list hence forward to all subscribers. + */ + return false; +} +#endif + /* BEGIN callback */ static void pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) @@ -2557,3 +2619,66 @@ split_string_to_list(char *rawstring, char separator, List **sl) return true; } + +/* + * Convert a string into a list of Oids + */ +static bool +split_string_to_oid_list(char *rawstring, char separator, List **sl) +{ + char *nextp; + bool done = false; + + nextp = rawstring; + + while (isspace(*nextp)) + nextp++; /* skip leading whitespace */ + + if (*nextp == '\0') + return true; /* allow empty string */ + + /* At the top of the loop, we are at start of a new identifier. */ + do + { + char *tok; + char *endp; + Oid originid; + + tok = nextp; + while (*nextp && *nextp != separator && !isspace(*nextp)) + { + if (*nextp == '\\') + nextp++; /* ignore next character because of escape */ + nextp++; + } + endp = nextp; + + while (isspace(*nextp)) + nextp++; /* skip trailing whitespace */ + + if (*nextp == separator) + { + nextp++; + while (isspace(*nextp)) + nextp++; /* skip leading whitespace for next */ + /* we expect another name, so done remains false */ + } + else if (*nextp == '\0') + done = true; + else + return false; /* invalid syntax */ + + /* Now safe to overwrite separator with a null */ + *endp = '\0'; + + /* + * Finished isolating origin id --- add it to list + */ + originid = (Oid) atoi(tok); + *sl = lappend_oid(*sl, originid); + + /* Loop back if we didn't reach end of string */ + } while (!done); + + return true; +} From b2a0522b59e62915b23b981542619d7a82eace77 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 13 Apr 2020 19:50:16 -0300 Subject: [PATCH 096/154] Improve Linux installation instructions Since there are some issues that are opened from time to time, I add a few instructions to Linux distros. I add instructions to install the available packages from Debian/Ubuntu and RHEL/CentOS. I also write some instructions to compile on those OSes. I hope it should clarify doubts about installation. --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5b820217fe71..420a370a6093 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,22 @@ Introduction **format version 2** produces a JSON object per tuple. Optional JSON object for beginning and end of transaction. Also, there are a variety of options to include properties. -Requirements -============ - -* PostgreSQL 9.4+ - Build and Install ================= -This extension is supported on [those platforms](http://www.postgresql.org/docs/current/static/supported-platforms.html) that PostgreSQL is. The installation steps depend on your operating system. +This extension is supported on [those platforms](http://www.postgresql.org/docs/current/static/supported-platforms.html) that PostgreSQL is. The installation steps depend on your operating system. [PostgreSQL yum repository](https://yum.postgresql.org) and [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt) provide wal2json packages. + +In Red Hat/CentOS: + +``` +$ sudo yum install wal2json12 +``` + +In Debian/Ubuntu: + +``` +$ sudo apt-get install postgresql12-wal2json +``` You can also keep up with the latest fixes and features cloning the Git repository. @@ -28,15 +35,38 @@ $ git clone https://github.com/eulerto/wal2json.git Unix based Operating Systems ---------------------------- -Before use this extension, you should build it and load it at the desirable database. +Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql12-devel` and add `/usr/pgsql-12/bin` to your search path (yum uses `12, 11, 10, 96, 95 or 94`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-12` and add `/usr/lib/postgresql/12/bin` to your search path. (apt uses `12, 11, 10, 9.6, 9.5 or 9.4`). + +If you compile PostgreSQL by yourself and install it in `/home/euler/pg12`: ``` -$ git clone https://github.com/eulerto/wal2json.git -$ cd wal2json -# Make sure your path includes the bin directory that contains the correct `pg_config` -$ PATH=/path/to/pg/bin:$PATH -$ USE_PGXS=1 make -$ USE_PGXS=1 make install +$ tar -zxf wal2json-wal2json_2_2.tar.gz +$ cd wal2json-wal2json_2_2 +$ export PATH=/home/euler/pg12/bin:$PATH +$ make +$ make install +``` + +If you are using [PostgreSQL yum repository](https://yum.postgresql.org): + +``` +$ sudo yum install postgresql12-devel +$ tar -zxf wal2json-wal2json_2_2.tar.gz +$ cd wal2json-wal2json_2_2 +$ export PATH=/usr/pgsql-12/bin:$PATH +$ make +$ make install +``` + +If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt): + +``` +$ sudo apt-get install postgresql-server-dev-12 +$ tar -zxf wal2json-wal2json_2_2.tar.gz +$ cd wal2json-wal2json_2_2 +$ export PATH=/usr/lib/postgresql/12/bin:$PATH +$ make +$ make install ``` Windows From 538e9a726f7cb51164497edd23a9f3c28db6daab Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 16 Apr 2020 20:17:02 -0300 Subject: [PATCH 097/154] Fix an oversight for old minor versions Format 2 (1b0cbac484f4fe5db80445f6721957511b4de7b7) forgot to consider the workaround I applied to TupleDescAttr (5352cc4193b956be446d6f5f21dd5282c463118b). Since I did not test with old minor versions, this bug was not caught by tests. This was reported in issue #162. --- wal2json.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wal2json.c b/wal2json.c index 28d6c13f4307..8eb941e3b0a9 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1646,7 +1646,11 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple bool found = false; char *type_str; +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) + attr = tupdesc->attrs[i]; +#else attr = TupleDescAttr(tupdesc, i); +#endif /* skip dropped or system columns */ if (attr->attisdropped || attr->attnum < 0) @@ -1673,7 +1677,11 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple { Form_pg_attribute iattr; +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) + iattr = idxdesc->attrs[j]; +#else iattr = TupleDescAttr(idxdesc, j); +#endif if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) found = true; } From c54d89649c3fe5e0aa79c3a87493935232e962a7 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 25 May 2020 20:10:50 -0300 Subject: [PATCH 098/154] Improve configuration section Add a comment explaining which parameters need adjust based on the version users are using. Version 10 or later just need to change wal_level, for example. Though, old versions have to adjust a few parameters to use logical replication. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 420a370a6093..630261b9e43b 100644 --- a/README.md +++ b/README.md @@ -84,13 +84,16 @@ You need to set up at least two parameters at postgresql.conf: ``` wal_level = logical +# +# these parameters only need to set in versions 9.4, 9.5 and 9.6 +# default values are ok in version 10 or later +# max_replication_slots = 10 +max_wal_senders = 10 ``` After changing these parameters, a restart is needed. -By default, PostgreSQL 10 or later doesn't need to adjust parameters. - Parameters ---------- From caaf9ac505519430c802d9ab1425e7c13007dc0c Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 2 May 2020 20:14:30 -0300 Subject: [PATCH 099/154] Add parameter include-column-positions This parameter is useful to detect schema changes (since attnum are numbered from 1 up). Both formats (1 and 2) are supported although element names are different ("columnpositions" for format 1 and "position" for format 2). Default is false. Issue #160 --- Makefile | 2 +- README.md | 1 + expected/position.out | 88 +++++++++++++++++++++++++++++++++++++++++++ sql/position.sql | 25 ++++++++++++ wal2json.c | 39 +++++++++++++++++++ 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 expected/position.out create mode 100644 sql/position.sql diff --git a/Makefile b/Makefile index aeb7bfdd8a1b..104ae4646bdf 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - include_domain_data_type truncate actions + include_domain_data_type truncate actions position PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/README.md b/README.md index 630261b9e43b..62f1ef177b5b 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ Parameters * `include-typmod`: add modifier to types that have it (eg. varchar(20) instead of varchar). Default is _true_. * `include-type-oids`: add type oids. Default is _false_. * `include-domain-data-type`: replace domain name with the underlying data type. Default is _false_. +* `include-column-positions`: add column position (_pg_attribute.attnum_). Default is _false_. * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. diff --git a/expected/position.out b/expected/position.out new file mode 100644 index 000000000000..6f97be572f95 --- /dev/null +++ b/expected/position.out @@ -0,0 +1,88 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +CREATE TABLE w2j_position (a integer, b integer, primary key(a)); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_position (a, b) VALUES(1,2); +UPDATE w2j_position SET b = 3 WHERE a = 1; +ALTER TABLE w2j_position ADD COLUMN c integer; +ALTER TABLE w2j_position DROP COLUMN b; +INSERT INTO w2j_position (a, c) VALUES(5,6); +UPDATE w2j_position SET c = 7 WHERE a = 5; +-- without include-column-position parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"change":[{"kind":"insert","schema":"public","table":"w2j_position","columnnames":["a","b"],"columntypes":["integer","integer"],"columnvalues":[1,2]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_position","columnnames":["a","b"],"columntypes":["integer","integer"],"columnvalues":[1,3],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_position","columnnames":["a","c"],"columntypes":["integer","integer"],"columnvalues":[5,6]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_position","columnnames":["a","c"],"columntypes":["integer","integer"],"columnvalues":[5,7],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[5]}}]} +(6 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":2}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":3}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":5},{"name":"c","type":"integer","value":6}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":5},{"name":"c","type":"integer","value":7}],"identity":[{"name":"a","type":"integer","value":5}]} + {"action":"C"} +(16 rows) + +-- with include-column-position parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-column-positions', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"change":[{"kind":"insert","schema":"public","table":"w2j_position","columnnames":["a","b"],"columntypes":["integer","integer"],"columnpositions":[1,2],"columnvalues":[1,2]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_position","columnnames":["a","b"],"columntypes":["integer","integer"],"columnpositions":[1,2],"columnvalues":[1,3],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_position","columnnames":["a","c"],"columntypes":["integer","integer"],"columnpositions":[1,3],"columnvalues":[5,6]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_position","columnnames":["a","c"],"columntypes":["integer","integer"],"columnpositions":[1,3],"columnvalues":[5,7],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[5]}}]} +(6 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-column-positions', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":1,"position":1},{"name":"b","type":"integer","value":2,"position":2}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":1,"position":1},{"name":"b","type":"integer","value":3,"position":2}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":5,"position":1},{"name":"c","type":"integer","value":6,"position":3}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_position","columns":[{"name":"a","type":"integer","value":5,"position":1},{"name":"c","type":"integer","value":7,"position":3}],"identity":[{"name":"a","type":"integer","value":5}]} + {"action":"C"} +(16 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + diff --git a/sql/position.sql b/sql/position.sql new file mode 100644 index 000000000000..ef984c3622ec --- /dev/null +++ b/sql/position.sql @@ -0,0 +1,25 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +CREATE TABLE w2j_position (a integer, b integer, primary key(a)); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO w2j_position (a, b) VALUES(1,2); +UPDATE w2j_position SET b = 3 WHERE a = 1; +ALTER TABLE w2j_position ADD COLUMN c integer; +ALTER TABLE w2j_position DROP COLUMN b; +INSERT INTO w2j_position (a, c) VALUES(5,6); +UPDATE w2j_position SET c = 7 WHERE a = 5; + +-- without include-column-position parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + +-- with include-column-position parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-column-positions', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-column-positions', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 8eb941e3b0a9..c8f42a082aca 100644 --- a/wal2json.c +++ b/wal2json.c @@ -56,6 +56,7 @@ typedef struct bool include_type_oids; /* include data type oids */ bool include_typmod; /* include typmod in types */ bool include_domain_data_type; /* include underlying data type of the domain */ + bool include_column_positions; /* include column numbers */ bool include_not_null; /* include not-null constraints */ bool pretty_print; /* pretty-print JSON? */ @@ -241,6 +242,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_type_oids = false; data->include_typmod = true; data->include_domain_data_type = false; + data->include_column_positions = false; data->pretty_print = false; data->write_in_chunks = false; data->include_lsn = false; @@ -407,6 +409,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-column-positions") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "include-column-positions argument is null"); + data->include_column_positions = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_column_positions)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-not-null") == 0) { if (elem->arg == NULL) @@ -899,6 +914,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu StringInfoData colnames; StringInfoData coltypes; StringInfoData coltypeoids; + StringInfoData colpositions; StringInfoData colnotnulls; StringInfoData colvalues; char comma[3] = ""; @@ -909,6 +925,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu initStringInfo(&coltypes); if (data->include_type_oids) initStringInfo(&coltypeoids); + if (data->include_column_positions) + initStringInfo(&colpositions); if (data->include_not_null) initStringInfo(&colnotnulls); initStringInfo(&colvalues); @@ -933,6 +951,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&coltypes, "%s%s%s\"columntypes\":%s[", data->ht, data->ht, data->ht, data->sp); if (data->include_type_oids) appendStringInfo(&coltypeoids, "%s%s%s\"columntypeoids\":%s[", data->ht, data->ht, data->ht, data->sp); + if (data->include_column_positions) + appendStringInfo(&colpositions, "%s%s%s\"columnpositions\":%s[", data->ht, data->ht, data->ht, data->sp); if (data->include_not_null) appendStringInfo(&colnotnulls, "%s%s%s\"columnoptionals\":%s[", data->ht, data->ht, data->ht, data->sp); appendStringInfo(&colvalues, "%s%s%s\"columnvalues\":%s[", data->ht, data->ht, data->ht, data->sp); @@ -1081,6 +1101,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu ReleaseSysCache(type_tuple); + if (!replident && data->include_column_positions) + appendStringInfo(&colpositions, "%s%d", comma, attr->attnum); + if (isnull) { appendStringInfo(&colvalues, "%snull", comma); @@ -1164,6 +1187,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&coltypes, "],%s", data->nl); if (data->include_type_oids) appendStringInfo(&coltypeoids, "],%s", data->nl); + if (data->include_column_positions) + appendStringInfo(&colpositions, "],%s", data->nl); if (data->include_not_null) appendStringInfo(&colnotnulls, "],%s", data->nl); if (hasreplident) @@ -1178,6 +1203,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(ctx->out, coltypes.data); if (data->include_type_oids) appendStringInfoString(ctx->out, coltypeoids.data); + if (data->include_column_positions) + appendStringInfoString(ctx->out, colpositions.data); if (data->include_not_null) appendStringInfoString(ctx->out, colnotnulls.data); appendStringInfoString(ctx->out, colvalues.data); @@ -1186,6 +1213,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu pfree(coltypes.data); if (data->include_type_oids) pfree(coltypeoids.data); + if (data->include_column_positions) + pfree(colpositions.data); if (data->include_not_null) pfree(colnotnulls.data); pfree(colvalues.data); @@ -1738,6 +1767,16 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple appendStringInfoString(ctx->out, ",\"optional\":true"); } + /* + * Print position for columns. Positions are only available for new + * tuple (INSERT, UPDATE). + */ + if (kind == PGOUTPUTJSON_CHANGE && data->include_column_positions) + { + appendStringInfoString(ctx->out, ",\"position\":"); + appendStringInfo(ctx->out, "%d", attr->attnum); + } + appendStringInfoChar(ctx->out, '}'); } From 9df8c055b8935b22fe7ce2916759230152013618 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 4 May 2020 10:53:37 -0300 Subject: [PATCH 100/154] Add parameter include-default This parameter adds "columndefaults" that contains all defaults values (same as pg_get_expr). Both formats (1 and 2) are supported although element names are different ("columndefaults" for format 1 and "default" for format 2). Each default value is represented as string because it can be an expression. Tests are included. Default is false. I also added prototypes to 2 static functions. --- Makefile | 2 +- README.md | 1 + expected/default.out | 66 +++++++++++++ sql/default.sql | 24 +++++ wal2json.c | 218 +++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 303 insertions(+), 8 deletions(-) create mode 100644 expected/default.out create mode 100644 sql/default.sql diff --git a/Makefile b/Makefile index 104ae4646bdf..584efa3946ae 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - include_domain_data_type truncate actions position + include_domain_data_type truncate actions position default PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/README.md b/README.md index 62f1ef177b5b..111f5bc08917 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ Parameters * `include-domain-data-type`: replace domain name with the underlying data type. Default is _false_. * `include-column-positions`: add column position (_pg_attribute.attnum_). Default is _false_. * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. +* `include-default`: add default expression. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. diff --git a/expected/default.out b/expected/default.out new file mode 100644 index 000000000000..69c85f5336c4 --- /dev/null +++ b/expected/default.out @@ -0,0 +1,66 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +CREATE TABLE w2j_default (a serial, b integer DEFAULT 6, c text DEFAULT 'wal2json', d timestamp DEFAULT '2020-07-12 11:55:30', e integer DEFAULT NULL, f integer, PRIMARY KEY(a)); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_default (b, c ,d, e, f) VALUES(2, 'test', '2020-03-01 08:09:00', 80, 10); +INSERT INTO w2j_default DEFAULT VALUES; +UPDATE w2j_default SET b = 3 WHERE a = 1; +-- without include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} +(3 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":2},{"name":"c","type":"text","value":"test"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020"},{"name":"e","type":"integer","value":80},{"name":"f","type":"integer","value":10}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"integer","value":6},{"name":"c","type":"text","value":"wal2json"},{"name":"d","type":"timestamp without time zone","value":"Sun Jul 12 11:55:30 2020"},{"name":"e","type":"integer","value":null},{"name":"f","type":"integer","value":null}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":3},{"name":"c","type":"text","value":"test"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020"},{"name":"e","type":"integer","value":80},{"name":"f","type":"integer","value":10}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} +(9 rows) + +-- with include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-default', '1'); + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} +(3 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-default', '1'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":2,"default":"6"},{"name":"c","type":"text","value":"test","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":80,"default":null},{"name":"f","type":"integer","value":10,"default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":2,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":6,"default":"6"},{"name":"c","type":"text","value":"wal2json","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Jul 12 11:55:30 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":null,"default":null},{"name":"f","type":"integer","value":null,"default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":3,"default":"6"},{"name":"c","type":"text","value":"test","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":80,"default":null},{"name":"f","type":"integer","value":10,"default":null}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} +(9 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE w2j_default; diff --git a/sql/default.sql b/sql/default.sql new file mode 100644 index 000000000000..8d3d107efb45 --- /dev/null +++ b/sql/default.sql @@ -0,0 +1,24 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +CREATE TABLE w2j_default (a serial, b integer DEFAULT 6, c text DEFAULT 'wal2json', d timestamp DEFAULT '2020-07-12 11:55:30', e integer DEFAULT NULL, f integer, PRIMARY KEY(a)); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO w2j_default (b, c ,d, e, f) VALUES(2, 'test', '2020-03-01 08:09:00', 80, 10); +INSERT INTO w2j_default DEFAULT VALUES; +UPDATE w2j_default SET b = 3 WHERE a = 1; + +-- without include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + +-- with include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-default', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-default', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE w2j_default; diff --git a/wal2json.c b/wal2json.c index c8f42a082aca..b4d39500bf82 100644 --- a/wal2json.c +++ b/wal2json.c @@ -12,6 +12,10 @@ */ #include "postgres.h" +#include "access/genam.h" +#include "access/heapam.h" +#include "catalog/indexing.h" +#include "catalog/pg_attrdef.h" #include "catalog/pg_type.h" #include "replication/logical.h" @@ -20,6 +24,7 @@ #endif #include "utils/builtins.h" +#include "utils/fmgroids.h" #include "utils/guc.h" #include "utils/json.h" #include "utils/lsyscache.h" @@ -58,6 +63,7 @@ typedef struct bool include_domain_data_type; /* include underlying data type of the domain */ bool include_column_positions; /* include column numbers */ bool include_not_null; /* include not-null constraints */ + bool include_default; /* include default expressions */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -126,6 +132,8 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferChange *change); #endif +static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident, Oid reloid); +static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident, Oid reloid); static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); static bool split_string_to_list(char *rawstring, char separator, List **sl); @@ -247,6 +255,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->write_in_chunks = false; data->include_lsn = false; data->include_not_null = false; + data->include_default = false; data->filter_origins = NIL; data->filter_tables = NIL; data->filter_msg_prefixes = NIL; @@ -435,6 +444,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-default") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "include-default argument is null"); + data->include_default = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_default)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "pretty-print") == 0) { if (elem->arg == NULL) @@ -898,7 +920,6 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, OutputPluginWrite(ctx, true); } - /* * Accumulate tuple information and stores it at the end * @@ -906,7 +927,7 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, * hasreplident: does this tuple has an associated replica identity? */ static void -tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident) +tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident, Oid reloid) { JsonDecodingData *data; int natt; @@ -916,9 +937,12 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu StringInfoData coltypeoids; StringInfoData colpositions; StringInfoData colnotnulls; + StringInfoData coldefaults; StringInfoData colvalues; char comma[3] = ""; + Relation defrel = NULL; + data = ctx->output_plugin_private; initStringInfo(&colnames); @@ -929,6 +953,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu initStringInfo(&colpositions); if (data->include_not_null) initStringInfo(&colnotnulls); + if (data->include_default) + initStringInfo(&coldefaults); initStringInfo(&colvalues); /* @@ -955,9 +981,20 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&colpositions, "%s%s%s\"columnpositions\":%s[", data->ht, data->ht, data->ht, data->sp); if (data->include_not_null) appendStringInfo(&colnotnulls, "%s%s%s\"columnoptionals\":%s[", data->ht, data->ht, data->ht, data->sp); + if (data->include_default) + appendStringInfo(&coldefaults, "%s%s%s\"columndefaults\":%s[", data->ht, data->ht, data->ht, data->sp); appendStringInfo(&colvalues, "%s%s%s\"columnvalues\":%s[", data->ht, data->ht, data->ht, data->sp); } + if (!replident && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + defrel = table_open(AttrDefaultRelationId, AccessShareLock); +#else + defrel = heap_open(AttrDefaultRelationId, AccessShareLock); +#endif + } + /* Print column information (name, type, value) */ for (natt = 0; natt < tupdesc->natts; natt++) { @@ -1104,6 +1141,71 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (!replident && data->include_column_positions) appendStringInfo(&colpositions, "%s%d", comma, attr->attnum); + /* + * Print default for columns. + */ + if (!replident && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + if (attr->atthasdef && attr->attgenerated == '\0') +#else + if (attr->atthasdef) +#endif + { + ScanKeyData scankeys[2]; + SysScanDesc scan; + HeapTuple def_tuple; + Datum def_value; + bool isnull; + char *result; + + ScanKeyInit(&scankeys[0], + Anum_pg_attrdef_adrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(reloid)); + ScanKeyInit(&scankeys[1], + Anum_pg_attrdef_adnum, + BTEqualStrategyNumber, F_INT2EQ, + Int16GetDatum(attr->attnum)); + + scan = systable_beginscan(defrel, AttrDefaultIndexId, true, + NULL, 2, scankeys); + + def_tuple = systable_getnext(scan); + if (HeapTupleIsValid(def_tuple)) + { + def_value = fastgetattr(def_tuple, Anum_pg_attrdef_adbin, defrel->rd_att, &isnull); + + if (!isnull) + { + result = TextDatumGetCString(DirectFunctionCall2(pg_get_expr, + def_value, + ObjectIdGetDatum(tuple->t_tableOid))); + + appendStringInfo(&coldefaults, "%s\"%s\"", comma, result); + pfree(result); + } + else + { + /* + * null means that default was not set. Is it possible? + * atthasdef shouldn't be set. + */ + appendStringInfo(&coldefaults, "%snull", comma); + } + } + + systable_endscan(scan); + } + else + { + /* + * no DEFAULT clause implicitly means that the default is NULL + */ + appendStringInfo(&coldefaults, "%snull", comma); + } + } + if (isnull) { appendStringInfo(&colvalues, "%snull", comma); @@ -1169,6 +1271,15 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu snprintf(comma, 3, ",%s", data->sp); } + if (!replident && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + table_close(defrel, AccessShareLock); +#else + heap_close(defrel, AccessShareLock); +#endif + } + /* Column info ends */ if (replident) { @@ -1191,6 +1302,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&colpositions, "],%s", data->nl); if (data->include_not_null) appendStringInfo(&colnotnulls, "],%s", data->nl); + if (data->include_default) + appendStringInfo(&coldefaults, "],%s", data->nl); if (hasreplident) appendStringInfo(&colvalues, "],%s", data->nl); else @@ -1207,6 +1320,8 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfoString(ctx->out, colpositions.data); if (data->include_not_null) appendStringInfoString(ctx->out, colnotnulls.data); + if (data->include_default) + appendStringInfoString(ctx->out, coldefaults.data); appendStringInfoString(ctx->out, colvalues.data); pfree(colnames.data); @@ -1217,14 +1332,16 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu pfree(colpositions.data); if (data->include_not_null) pfree(colnotnulls.data); + if (data->include_default) + pfree(coldefaults.data); pfree(colvalues.data); } /* Print columns information */ static void -columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident) +columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident, Oid reloid) { - tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, hasreplident); + tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, hasreplident, reloid); } /* Print replica identity information */ @@ -1232,7 +1349,7 @@ static void identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc) { /* Last parameter does not matter */ - tuple_to_stringinfo(ctx, tupdesc, tuple, indexdesc, true, false); + tuple_to_stringinfo(ctx, tupdesc, tuple, indexdesc, true, false, InvalidOid); } /* Callback for individual changed tuples */ @@ -1471,11 +1588,11 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { case REORDER_BUFFER_CHANGE_INSERT: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, change->data.tp.relnode.relNode); break; case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); /* * The old tuple is available when: @@ -1627,6 +1744,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple { JsonDecodingData *data; TupleDesc tupdesc; + Relation defrel = NULL; Relation idxrel; TupleDesc idxdesc = NULL; int i; @@ -1668,6 +1786,16 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple elog(ERROR, "table does not have primary key or replica identity"); } + /* open pg_attrdef in preparation to get default values from columns */ + if (kind == PGOUTPUTJSON_CHANGE && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + defrel = table_open(AttrDefaultRelationId, AccessShareLock); +#else + defrel = heap_open(AttrDefaultRelationId, AccessShareLock); +#endif + } + for (i = 0; i < tupdesc->natts; i++) { Form_pg_attribute attr; @@ -1777,9 +1905,85 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple appendStringInfo(ctx->out, "%d", attr->attnum); } + /* + * Print default for columns. + */ + if (kind == PGOUTPUTJSON_CHANGE && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + if (attr->atthasdef && attr->attgenerated == '\0') +#else + if (attr->atthasdef) +#endif + { + ScanKeyData scankeys[2]; + SysScanDesc scan; + HeapTuple def_tuple; + Datum def_value; + bool isnull; + char *result; + + ScanKeyInit(&scankeys[0], + Anum_pg_attrdef_adrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relation->rd_id)); + ScanKeyInit(&scankeys[1], + Anum_pg_attrdef_adnum, + BTEqualStrategyNumber, F_INT2EQ, + Int16GetDatum(attr->attnum)); + + scan = systable_beginscan(defrel, AttrDefaultIndexId, true, + NULL, 2, scankeys); + + def_tuple = systable_getnext(scan); + if (HeapTupleIsValid(def_tuple)) + { + def_value = fastgetattr(def_tuple, Anum_pg_attrdef_adbin, defrel->rd_att, &isnull); + + if (!isnull) + { + result = TextDatumGetCString(DirectFunctionCall2(pg_get_expr, + def_value, + ObjectIdGetDatum(relation->rd_id))); + + appendStringInfoString(ctx->out, ",\"default\":"); + appendStringInfo(ctx->out, "\"%s\"", result); + pfree(result); + } + else + { + /* + * null means that default was not set. Is it possible? + * atthasdef shouldn't be set. + */ + appendStringInfoString(ctx->out, ",\"default\":null"); + } + } + + systable_endscan(scan); + } + else + { + /* + * no DEFAULT clause implicitly means that the default is NULL + */ + appendStringInfoString(ctx->out, ",\"default\":null"); + } + } + appendStringInfoChar(ctx->out, '}'); } + /* close pg_attrdef */ + if (kind == PGOUTPUTJSON_CHANGE && data->include_default) + { +#if PG_VERSION_NUM >= 120000 + table_close(defrel, AccessShareLock); +#else + heap_close(defrel, AccessShareLock); +#endif + } + pfree(values); pfree(nulls); } From 35113849acb24038a5e3f492358f407703b6b2d1 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 15 Apr 2020 23:23:59 -0300 Subject: [PATCH 101/154] Add parameter include-pk This parameter adds primary key information if it is available. Both formats (1 and 2) are supported. Each "pk" object provides column name and its data type. Tests are included. Default is false. --- Makefile | 2 +- README.md | 1 + expected/pk.out | 209 ++++++++++++++++++++++++++++++++++++++ sql/pk.sql | 54 ++++++++++ wal2json.c | 261 +++++++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 513 insertions(+), 14 deletions(-) create mode 100644 expected/pk.out create mode 100644 sql/pk.sql diff --git a/Makefile b/Makefile index 584efa3946ae..c9c6d4f95c6c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - include_domain_data_type truncate actions position default + include_domain_data_type truncate actions position default pk PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/README.md b/README.md index 111f5bc08917..79d983cb3f1f 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ Parameters * `include-column-positions`: add column position (_pg_attribute.attnum_). Default is _false_. * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. * `include-default`: add default expression. Default is _false_. +* `include-pk`: add _primary key_ information as _pk_. Column name and data type is included. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. diff --git a/expected/pk.out b/expected/pk.out new file mode 100644 index 000000000000..c999059995ae --- /dev/null +++ b/expected/pk.out @@ -0,0 +1,209 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; +CREATE TABLE w2j_pk_with_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3), +PRIMARY KEY(b, d, e) +); +CREATE TABLE w2j_pk_without_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3) +); +CREATE TABLE w2j_pk_with_ri ( +a int NOT NULL, +b timestamp, +c text, +d boolean, +e numeric(5,3), +UNIQUE(a) +); +ALTER TABLE w2j_pk_with_ri REPLICA IDENTITY USING INDEX w2j_pk_with_ri_a_key; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_pk_with_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_pk_with_pk SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_with_pk; +INSERT INTO w2j_pk_without_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_pk_without_pk SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_without_pk; +INSERT INTO w2j_pk_with_ri (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Inia Araguaiaensis', true, 4.56); +UPDATE w2j_pk_with_ri SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_with_ri; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); +WARNING: table "w2j_pk_without_pk" without primary key or replica identity is nothing +WARNING: table "w2j_pk_without_pk" without primary key or replica identity is nothing + data +--------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_pk_with_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560],+ + "pk": { + + "pknames": ["b", "d", "e"], + + "pktypes": ["timestamp", "bool", "numeric"] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_pk_with_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Sun Apr 26 16:23:59 2020", "Panthera Onca", false, 4.560], + + "pk": { + + "pknames": ["b", "d", "e"], + + "pktypes": ["timestamp", "bool", "numeric"] + + }, + + "oldkeys": { + + "keynames": ["b", "d", "e"], + + "keytypes": ["timestamp", "bool", "numeric"], + + "keyvalues": ["Sun Apr 26 16:23:59 2020", true, 4.560] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "w2j_pk_with_pk", + + "pk": { + + "pknames": ["b", "d", "e"], + + "pktypes": ["timestamp", "bool", "numeric"] + + }, + + "oldkeys": { + + "keynames": ["b", "d", "e"], + + "keytypes": ["timestamp", "bool", "numeric"], + + "keyvalues": ["Sun Apr 26 16:23:59 2020", false, 4.560] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_pk_without_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560] + + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_pk_with_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Inia Araguaiaensis", true, 4.560] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_pk_with_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Sun Apr 26 16:23:59 2020", "Panthera Onca", false, 4.560], + + "oldkeys": { + + "keynames": ["a"], + + "keytypes": ["int4"], + + "keyvalues": [123] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "w2j_pk_with_ri", + + "oldkeys": { + + "keynames": ["a"], + + "keytypes": ["int4"], + + "keyvalues": [456] + + } + + } + + ] + + } +(9 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); +WARNING: no tuple identifier for UPDATE in table "public"."w2j_pk_without_pk" +WARNING: no tuple identifier for DELETE in table "public"."w2j_pk_without_pk" + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_pk_with_pk","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[{"name":"b","type":"timestamp without time zone"},{"name":"d","type":"boolean"},{"name":"e","type":"numeric(5,3)"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_pk_with_pk","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"d","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":4.560}],"identity":[{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[{"name":"b","type":"timestamp without time zone"},{"name":"d","type":"boolean"},{"name":"e","type":"numeric(5,3)"}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"w2j_pk_with_pk","identity":[{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"d","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[{"name":"b","type":"timestamp without time zone"},{"name":"d","type":"boolean"},{"name":"e","type":"numeric(5,3)"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_pk_without_pk","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_pk_with_ri","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Inia Araguaiaensis"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_pk_with_ri","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"d","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":4.560}],"identity":[{"name":"a","type":"integer","value":123}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"w2j_pk_with_ri","identity":[{"name":"a","type":"integer","value":456}],"pk":[]} + {"action":"C"} +(25 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE w2j_pk_with_pk; +DROP TABLE w2j_pk_without_pk; +DROP TABLE w2j_pk_with_ri; diff --git a/sql/pk.sql b/sql/pk.sql new file mode 100644 index 000000000000..160454f15f67 --- /dev/null +++ b/sql/pk.sql @@ -0,0 +1,54 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; + +CREATE TABLE w2j_pk_with_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3), +PRIMARY KEY(b, d, e) +); + +CREATE TABLE w2j_pk_without_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3) +); + +CREATE TABLE w2j_pk_with_ri ( +a int NOT NULL, +b timestamp, +c text, +d boolean, +e numeric(5,3), +UNIQUE(a) +); +ALTER TABLE w2j_pk_with_ri REPLICA IDENTITY USING INDEX w2j_pk_with_ri_a_key; + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO w2j_pk_with_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_pk_with_pk SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_with_pk; + +INSERT INTO w2j_pk_without_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_pk_without_pk SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_without_pk; + +INSERT INTO w2j_pk_with_ri (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Inia Araguaiaensis', true, 4.56); +UPDATE w2j_pk_with_ri SET a = 456, c = 'Panthera Onca', d = false; +DELETE FROM w2j_pk_with_ri; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE w2j_pk_with_pk; +DROP TABLE w2j_pk_without_pk; +DROP TABLE w2j_pk_with_ri; diff --git a/wal2json.c b/wal2json.c index b4d39500bf82..c3465a4d5bab 100644 --- a/wal2json.c +++ b/wal2json.c @@ -64,6 +64,7 @@ typedef struct bool include_column_positions; /* include column numbers */ bool include_not_null; /* include not-null constraints */ bool include_default; /* include default expressions */ + bool include_pk; /* include primary key */ bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? */ @@ -96,7 +97,8 @@ typedef struct typedef enum { PGOUTPUTJSON_CHANGE, - PGOUTPUTJSON_IDENTITY + PGOUTPUTJSON_IDENTITY, + PGOUTPUTJSON_PK } PGOutputJsonKind; typedef struct SelectTable @@ -132,8 +134,9 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferChange *change); #endif -static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident, Oid reloid); -static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident, Oid reloid); +static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Oid reloid); +static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool addcomma, Oid reloid); +static void pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool addcomma); static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); static bool split_string_to_list(char *rawstring, char separator, List **sl); @@ -244,6 +247,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_transaction = true; data->include_xids = false; data->include_timestamp = false; + data->include_pk = false; data->include_origin = false; data->include_schemas = true; data->include_types = true; @@ -340,6 +344,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "include-pk") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "include-pk argument is null"); + data->include_pk = true; + } + else if (!parse_bool(strVal(elem->arg), &data->include_pk)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "include-origin") == 0) { if (elem->arg == NULL) @@ -924,10 +941,9 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, * Accumulate tuple information and stores it at the end * * replident: is this tuple a replica identity? - * hasreplident: does this tuple has an associated replica identity? */ static void -tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool hasreplident, Oid reloid) +tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool addcomma, Oid reloid) { JsonDecodingData *data; int natt; @@ -1304,7 +1320,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu appendStringInfo(&colnotnulls, "],%s", data->nl); if (data->include_default) appendStringInfo(&coldefaults, "],%s", data->nl); - if (hasreplident) + if (addcomma) appendStringInfo(&colvalues, "],%s", data->nl); else appendStringInfo(&colvalues, "]%s", data->nl); @@ -1339,9 +1355,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* Print columns information */ static void -columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool hasreplident, Oid reloid) +columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Oid reloid) { - tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, hasreplident, reloid); + tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, addcomma, reloid); } /* Print replica identity information */ @@ -1352,6 +1368,153 @@ identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple_to_stringinfo(ctx, tupdesc, tuple, indexdesc, true, false, InvalidOid); } +/* Print primary key information */ +static void +pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool addcomma) +{ + JsonDecodingData *data; + int natt; + char comma[3] = ""; + + StringInfoData pknames; + StringInfoData pktypes; + + data = ctx->output_plugin_private; + + /* no primary key */ + if (indexdesc == NULL) + return; + + initStringInfo(&pknames); + initStringInfo(&pktypes); + + appendStringInfo(&pknames, "%s%s%s\"pk\":%s{%s", data->ht, data->ht, data->ht, data->sp, data->nl); + appendStringInfo(&pknames, "%s%s%s%s\"pknames\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); + appendStringInfo(&pktypes, "%s%s%s%s\"pktypes\":%s[", data->ht, data->ht, data->ht, data->ht, data->sp); + + /* Print column information (name, type, value) */ + for (natt = 0; natt < tupdesc->natts; natt++) + { + Form_pg_attribute attr; /* the attribute itself */ + Oid typid; /* type of current attribute */ + HeapTuple type_tuple; /* information about a type */ + + /* + * Commit d34a74dd064af959acd9040446925d9d53dff15b introduced + * TupleDescAttr() in back branches. If the version supports + * this macro, use it. Version 10 and later already support it. + */ +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) + attr = tupdesc->attrs[natt]; +#else + attr = TupleDescAttr(tupdesc, natt); +#endif + + /* Do not print dropped or system columns */ + if (attr->attisdropped || attr->attnum < 0) + continue; + + /* Search pk columns in whole heap tuple */ + if (indexdesc != NULL) + { + int j; + bool found_col = false; + + for (j = 0; j < indexdesc->natts; j++) + { + Form_pg_attribute iattr; + + /* See explanation a few lines above. */ +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) + iattr = indexdesc->attrs[j]; +#else + iattr = TupleDescAttr(indexdesc, j); +#endif + + if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) + found_col = true; + } + + /* Print only indexed columns */ + if (!found_col) + continue; + } + + typid = attr->atttypid; + + /* Figure out type name */ + type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (!HeapTupleIsValid(type_tuple)) + elog(ERROR, "cache lookup failed for type %u", typid); + + /* Accumulate each column info */ + appendStringInfo(&pknames, "%s", comma); + escape_json(&pknames, NameStr(attr->attname)); + + if (data->include_types) + { + char *type_str; + Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); + + /* + * It is a domain. Replace domain name with base data type if + * include_domain_data_type is enabled. + */ + if (type_form->typtype == TYPTYPE_DOMAIN && data->include_domain_data_type) + { + typid = type_form->typbasetype; + if (data->include_typmod) + { + type_str = format_type_with_typemod(type_form->typbasetype, type_form->typtypmod); + } + else + { + /* + * Since we are not using a format function, grab base type + * name from Form_pg_type. + */ + type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (!HeapTupleIsValid(type_tuple)) + elog(ERROR, "cache lookup failed for type %u", typid); + type_form = (Form_pg_type) GETSTRUCT(type_tuple); + type_str = pstrdup(NameStr(type_form->typname)); + } + } + else + { + if (data->include_typmod) + type_str = TextDatumGetCString(DirectFunctionCall2(format_type, attr->atttypid, attr->atttypmod)); + else + type_str = pstrdup(NameStr(type_form->typname)); + } + + appendStringInfo(&pktypes, "%s", comma); + escape_json(&pktypes, type_str); + + pfree(type_str); + } + + ReleaseSysCache(type_tuple); + + /* The first column does not have comma */ + if (strcmp(comma, "") == 0) + snprintf(comma, 3, ",%s", data->sp); + } + + appendStringInfo(&pknames, "],%s", data->nl); + appendStringInfo(&pktypes, "]%s", data->nl); + if (addcomma) + appendStringInfo(&pktypes, "%s%s%s},%s", data->ht, data->ht, data->ht, data->nl); + else + appendStringInfo(&pktypes, "%s%s%s}%s", data->ht, data->ht, data->ht, data->nl); + + appendStringInfoString(ctx->out, pknames.data); + appendStringInfoString(ctx->out, pktypes.data); + + pfree(pknames.data); + pfree(pktypes.data); +} + /* Callback for individual changed tuples */ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -1379,6 +1542,9 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation indexrel; TupleDesc indexdesc; + Relation pkrel = NULL; + TupleDesc pkdesc = NULL; + char *schemaname; char *tablename; @@ -1584,15 +1750,42 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, escape_json(ctx->out, NameStr(class_form->relname)); appendStringInfo(ctx->out, ",%s", data->nl); + if (data->include_pk) + { +#if PG_VERSION_NUM >= 100000 + if (OidIsValid(relation->rd_pkindex)) /* 10+ */ + { + pkrel = RelationIdGetRelation(relation->rd_pkindex); + pkdesc = RelationGetDescr(pkrel); + } +#else + if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) + { + pkrel = RelationIdGetRelation(relation->rd_replidindex); + pkdesc = RelationGetDescr(pkrel); + } +#endif + } + switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, change->data.tp.relnode.relNode); + if (data->include_pk && pkrel != NULL) + { + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, false); + } + else + { + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, change->data.tp.relnode.relNode); + } break; case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); + if (data->include_pk && pkrel != NULL) + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, true); /* * The old tuple is available when: @@ -1626,6 +1819,9 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } break; case REORDER_BUFFER_CHANGE_DELETE: + if (data->include_pk && pkrel != NULL) + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, true); + /* Print the replica identity */ indexrel = RelationIdGetRelation(relation->rd_replidindex); if (indexrel != NULL) @@ -1648,6 +1844,9 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } + if (data->include_pk && pkrel != NULL) + RelationClose(pkrel); + appendStringInfo(ctx->out, "%s%s}", data->ht, data->ht); MemoryContextSwitchTo(old); @@ -1785,6 +1984,22 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple else if (relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) elog(ERROR, "table does not have primary key or replica identity"); } + else if (kind == PGOUTPUTJSON_PK) + { +#if PG_VERSION_NUM >= 100000 + if (OidIsValid(relation->rd_pkindex)) /* 10+ */ + { + idxrel = RelationIdGetRelation(relation->rd_pkindex); + idxdesc = RelationGetDescr(idxrel); + } +#else + if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) + { + idxrel = RelationIdGetRelation(relation->rd_replidindex); + idxdesc = RelationGetDescr(idxrel); + } +#endif + } /* open pg_attrdef in preparation to get default values from columns */ if (kind == PGOUTPUTJSON_CHANGE && data->include_default) @@ -1817,7 +2032,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple * oldtuple contains NULL on those values that are not defined by * REPLICA IDENTITY. In this case, print only non-null values. */ - if (nulls[i] && kind == PGOUTPUTJSON_IDENTITY) + if (nulls[i] && (kind == PGOUTPUTJSON_PK || kind == PGOUTPUTJSON_IDENTITY)) continue; /* don't send unchanged TOAST Datum */ @@ -1828,7 +2043,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple * Is it replica identity column? Print only those columns or all * columns if REPLICA IDENTITY FULL is set. */ - if (kind == PGOUTPUTJSON_IDENTITY && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) + if (kind == PGOUTPUTJSON_PK || (kind == PGOUTPUTJSON_IDENTITY && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL)) { for (j = 0; j < idxdesc->natts; j++) { @@ -1880,8 +2095,11 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple ReleaseSysCache(type_tuple); } - appendStringInfoString(ctx->out, ",\"value\":"); - pg_decode_write_value(ctx, values[i], nulls[i], attr->atttypid); + if (kind != PGOUTPUTJSON_PK) + { + appendStringInfoString(ctx->out, ",\"value\":"); + pg_decode_write_value(ctx, values[i], nulls[i], attr->atttypid); + } /* * Print optional for columns. This information is redundant for @@ -2147,6 +2365,23 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat } } + if (data->include_pk) + { + appendStringInfoString(ctx->out, ",\"pk\":["); +#if PG_VERSION_NUM >= 100000 + if (OidIsValid(relation->rd_pkindex)) +#else + if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) +#endif + { + if (change->data.tp.oldtuple != NULL) + pg_decode_write_tuple(ctx, relation, &change->data.tp.oldtuple->tuple, PGOUTPUTJSON_PK); + else + pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_PK); + } + appendStringInfoChar(ctx->out, ']'); + } + appendStringInfoChar(ctx->out, '}'); OutputPluginWrite(ctx, true); From 8600d480de304ffe4c6a313b6fba1e411ab2e706 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 26 Jul 2020 16:01:52 -0300 Subject: [PATCH 102/154] Fix an oversight in format 2: nextlsn Format 2 (1b0cbac484f4fe5db80445f6721957511b4de7b7) forgot to add nextlsn. Format 1 includes this information if include-lsn is provided. This information can be useful for applications that use LSN position as a restart point. --- wal2json.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wal2json.c b/wal2json.c index c3465a4d5bab..d90fd795cda6 100644 --- a/wal2json.c +++ b/wal2json.c @@ -853,6 +853,10 @@ pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(txn->final_lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); + + lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(txn->end_lsn))); + appendStringInfo(ctx->out, ",\"nextlsn\":\"%s\"", lsn_str); + pfree(lsn_str); } appendStringInfoChar(ctx->out, '}'); @@ -931,6 +935,10 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, char *lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(commit_lsn))); appendStringInfo(ctx->out, ",\"lsn\":\"%s\"", lsn_str); pfree(lsn_str); + + lsn_str = DatumGetCString(DirectFunctionCall1(pg_lsn_out, UInt64GetDatum(txn->end_lsn))); + appendStringInfo(ctx->out, ",\"nextlsn\":\"%s\"", lsn_str); + pfree(lsn_str); } appendStringInfoChar(ctx->out, '}'); From a5d764fa1ef9d8c9c67a8cd381dad1381495c92d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 24 Aug 2020 21:56:22 -0300 Subject: [PATCH 103/154] Fix package name As pointed by @MaxmaxmaximusAWS Debian/Ubuntu package name was wrong. It fixes #175. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79d983cb3f1f..564d8922d77c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ sudo yum install wal2json12 In Debian/Ubuntu: ``` -$ sudo apt-get install postgresql12-wal2json +$ sudo apt-get install postgresql-12-wal2json ``` You can also keep up with the latest fixes and features cloning the Git repository. From 2ad272d2bb163407c1acad1dc279f2af6edb14a5 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 26 Sep 2020 10:23:13 -0300 Subject: [PATCH 104/154] Update instructions to Postgres 13 Since Postgres 13 was released a few days ago, let's update wal2json instructions. I also replaced wal2json version with the latest version (2.3). --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 564d8922d77c..7f64f742be2f 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ This extension is supported on [those platforms](http://www.postgresql.org/docs/ In Red Hat/CentOS: ``` -$ sudo yum install wal2json12 +$ sudo yum install wal2json13 ``` In Debian/Ubuntu: ``` -$ sudo apt-get install postgresql-12-wal2json +$ sudo apt-get install postgresql-13-wal2json ``` You can also keep up with the latest fixes and features cloning the Git repository. @@ -35,14 +35,14 @@ $ git clone https://github.com/eulerto/wal2json.git Unix based Operating Systems ---------------------------- -Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql12-devel` and add `/usr/pgsql-12/bin` to your search path (yum uses `12, 11, 10, 96, 95 or 94`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-12` and add `/usr/lib/postgresql/12/bin` to your search path. (apt uses `12, 11, 10, 9.6, 9.5 or 9.4`). +Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql13-devel` and add `/usr/pgsql-13/bin` to your search path (yum uses `13, 12, 11, 10, 96 or 95`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-13` and add `/usr/lib/postgresql/13/bin` to your search path. (apt uses `13, 12, 11, 10, 9.6 or 9.5`). -If you compile PostgreSQL by yourself and install it in `/home/euler/pg12`: +If you compile PostgreSQL by yourself and install it in `/home/euler/pg13`: ``` -$ tar -zxf wal2json-wal2json_2_2.tar.gz -$ cd wal2json-wal2json_2_2 -$ export PATH=/home/euler/pg12/bin:$PATH +$ tar -zxf wal2json-wal2json_2_3.tar.gz +$ cd wal2json-wal2json_2_3 +$ export PATH=/home/euler/pg13/bin:$PATH $ make $ make install ``` @@ -50,10 +50,10 @@ $ make install If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` -$ sudo yum install postgresql12-devel -$ tar -zxf wal2json-wal2json_2_2.tar.gz -$ cd wal2json-wal2json_2_2 -$ export PATH=/usr/pgsql-12/bin:$PATH +$ sudo yum install postgresql13-devel +$ tar -zxf wal2json-wal2json_2_3.tar.gz +$ cd wal2json-wal2json_2_3 +$ export PATH=/usr/pgsql-13/bin:$PATH $ make $ make install ``` @@ -61,10 +61,10 @@ $ make install If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt): ``` -$ sudo apt-get install postgresql-server-dev-12 -$ tar -zxf wal2json-wal2json_2_2.tar.gz -$ cd wal2json-wal2json_2_2 -$ export PATH=/usr/lib/postgresql/12/bin:$PATH +$ sudo apt-get install postgresql-server-dev-13 +$ tar -zxf wal2json-wal2json_2_3.tar.gz +$ cd wal2json-wal2json_2_3 +$ export PATH=/usr/lib/postgresql/13/bin:$PATH $ make $ make install ``` From b70f3b87a8101a7ca174d00bd34919d19c9f725e Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 20 Oct 2020 15:39:05 -0300 Subject: [PATCH 105/154] Improve pretty print Replace strcpy() and strncpy() with an assignment. --- wal2json.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wal2json.c b/wal2json.c index d90fd795cda6..1c611d7eccbf 100644 --- a/wal2json.c +++ b/wal2json.c @@ -284,9 +284,9 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is } /* pretty print */ - strcpy(data->ht, ""); - strcpy(data->nl, ""); - strcpy(data->sp, ""); + data->ht[0] = '\0'; + data->nl[0] = '\0'; + data->sp[0] = '\0'; /* add all tables in all schemas by default */ t = palloc0(sizeof(SelectTable)); @@ -489,9 +489,9 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is if (data->pretty_print) { - strncpy(data->ht, "\t", 1); - strncpy(data->nl, "\n", 1); - strncpy(data->sp, " ", 1); + data->ht[0] = '\t'; + data->nl[0] = '\n'; + data->sp[0] = ' '; } } else if (strcmp(elem->defname, "write-in-chunks") == 0) From 37d3bfba40956b4199ded32ffff57cf21aa9297a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 21 Nov 2020 15:15:06 -0300 Subject: [PATCH 106/154] Improve documentation Add 'message' usage to the examples. In comparison to the widely used output plugins such as pgoutput and pglogical 2, wal2json is the only plugin that supports message_cb. --- README.md | 127 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 101 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 7f64f742be2f..c1b3ac357b40 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ You are ready to try **wal2json**. In one terminal: ``` $ pg_recvlogical -d postgres --slot test_slot --create-slot -P wal2json -$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -f - +$ pg_recvlogical -d postgres --slot test_slot --start -o pretty-print=1 -o add-msg-prefixes=wal2json -f - ``` In another terminal: @@ -168,13 +168,19 @@ BEGIN; INSERT INTO table_with_pk (b, c) VALUES('Backup and Restore', now()); INSERT INTO table_with_pk (b, c) VALUES('Tuning', now()); INSERT INTO table_with_pk (b, c) VALUES('Replication', now()); +SELECT pg_logical_emit_message(true, 'wal2json', 'this message will be delivered'); +SELECT pg_logical_emit_message(true, 'pgoutput', 'this message will be filtered'); DELETE FROM table_with_pk WHERE a < 3; +SELECT pg_logical_emit_message(false, 'wal2json', 'this non-transactional message will be delivered even if you rollback the transaction'); INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); -- it is not added to stream because there isn't a pk or a replica identity UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; +DROP TABLE table1_with_pk; +DROP TABLE table1_without_pk; + $ psql -At -f /tmp/example1.sql postgres CREATE TABLE CREATE TABLE @@ -182,10 +188,15 @@ BEGIN INSERT 0 1 INSERT 0 1 INSERT 0 1 +3/78BFC828 +3/78BFC880 DELETE 2 +3/78BFC990 INSERT 0 1 UPDATE 1 COMMIT +DROP TABLE +DROP TABLE ``` The output in the first terminal is: @@ -199,13 +210,23 @@ The output in the first terminal is: "change": [ ] } -WARNING: table "table_without_pk" without primary key or replica identity is nothing +{ + "change": [ + { + "kind": "message", + "transactional": false, + "prefix": "wal2json", + "content": "this non-transactional message will be delivered even if you rollback the transaction" + } + ] +} +WARNING: table "table1_without_pk" without primary key or replica identity is nothing { "change": [ { "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table1_with_pk", "columnnames": ["a", "b", "c"], "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], "columnvalues": [1, "Backup and Restore", "2018-03-27 11:58:28.988414"] @@ -213,7 +234,7 @@ WARNING: table "table_without_pk" without primary key or replica identity is no ,{ "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table1_with_pk", "columnnames": ["a", "b", "c"], "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], "columnvalues": [2, "Tuning", "2018-03-27 11:58:28.988414"] @@ -221,15 +242,21 @@ WARNING: table "table_without_pk" without primary key or replica identity is no ,{ "kind": "insert", "schema": "public", - "table": "table_with_pk", + "table": "table1_with_pk", "columnnames": ["a", "b", "c"], "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], "columnvalues": [3, "Replication", "2018-03-27 11:58:28.988414"] } + ,{ + "kind": "message", + "transactional": true, + "prefix": "wal2json", + "content": "this message will be delivered" + } ,{ "kind": "delete", "schema": "public", - "table": "table_with_pk", + "table": "table1_with_pk", "oldkeys": { "keynames": ["a", "c"], "keytypes": ["integer", "timestamp without time zone"], @@ -239,7 +266,7 @@ WARNING: table "table_without_pk" without primary key or replica identity is no ,{ "kind": "delete", "schema": "public", - "table": "table_with_pk", + "table": "table1_with_pk", "oldkeys": { "keynames": ["a", "c"], "keytypes": ["integer", "timestamp without time zone"], @@ -249,13 +276,21 @@ WARNING: table "table_without_pk" without primary key or replica identity is no ,{ "kind": "insert", "schema": "public", - "table": "table_without_pk", + "table": "table1_without_pk", "columnnames": ["a", "b", "c"], "columntypes": ["integer", "numeric(5,2)", "text"], "columnvalues": [1, 2.34, "Tapir"] } ] } +{ + "change": [ + ] +} +{ + "change": [ + ] +} ``` Dropping the slot in the first terminal: @@ -279,15 +314,21 @@ BEGIN; INSERT INTO table2_with_pk (b, c) VALUES('Backup and Restore', now()); INSERT INTO table2_with_pk (b, c) VALUES('Tuning', now()); INSERT INTO table2_with_pk (b, c) VALUES('Replication', now()); +SELECT pg_logical_emit_message(true, 'wal2json', 'this message will be delivered'); +SELECT pg_logical_emit_message(true, 'pgoutput', 'this message will be filtered'); DELETE FROM table2_with_pk WHERE a < 3; +SELECT pg_logical_emit_message(false, 'wal2json', 'this non-transactional message will be delivered even if you rollback the transaction'); INSERT INTO table2_without_pk (b, c) VALUES(2.34, 'Tapir'); -- it is not added to stream because there isn't a pk or a replica identity UPDATE table2_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; -SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'pretty-print', '1', 'add-msg-prefixes', 'wal2json'); SELECT 'stop' FROM pg_drop_replication_slot('test_slot'); + +DROP TABLE table2_with_pk; +DROP TABLE table2_without_pk; ``` The script above produces the output below: @@ -301,10 +342,23 @@ BEGIN INSERT 0 1 INSERT 0 1 INSERT 0 1 +3/78C2CA50 +3/78C2CAA8 DELETE 2 +3/78C2CBD8 INSERT 0 1 UPDATE 1 COMMIT +{ + "change": [ + { + "kind": "message", + "transactional": false, + "prefix": "wal2json", + "content": "this non-transactional message will be delivered even if you rollback the transaction" + } + ] +} psql:/tmp/example2.sql:17: WARNING: table "table2_without_pk" without primary key or replica identity is nothing { "change": [ @@ -332,6 +386,12 @@ psql:/tmp/example2.sql:17: WARNING: table "table2_without_pk" without primary k "columntypes": ["integer", "character varying(30)", "timestamp without time zone"], "columnvalues": [3, "Replication", "2018-03-27 12:05:29.914496"] } + ,{ + "kind": "message", + "transactional": true, + "prefix": "wal2json", + "content": "this message will be delivered" + } ,{ "kind": "delete", "schema": "public", @@ -363,30 +423,38 @@ psql:/tmp/example2.sql:17: WARNING: table "table2_without_pk" without primary k ] } stop +DROP TABLE +DROP TABLE ``` Let's repeat the same example with `format-version` 2: ``` $ cat /tmp/example3.sql -CREATE TABLE table2_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); -CREATE TABLE table2_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); +CREATE TABLE table3_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table3_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); SELECT 'init' FROM pg_create_logical_replication_slot('test_slot', 'wal2json'); BEGIN; -INSERT INTO table2_with_pk (b, c) VALUES('Backup and Restore', now()); -INSERT INTO table2_with_pk (b, c) VALUES('Tuning', now()); -INSERT INTO table2_with_pk (b, c) VALUES('Replication', now()); -DELETE FROM table2_with_pk WHERE a < 3; - -INSERT INTO table2_without_pk (b, c) VALUES(2.34, 'Tapir'); +INSERT INTO table3_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table3_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table3_with_pk (b, c) VALUES('Replication', now()); +SELECT pg_logical_emit_message(true, 'wal2json', 'this message will be delivered'); +SELECT pg_logical_emit_message(true, 'pgoutput', 'this message will be filtered'); +DELETE FROM table3_with_pk WHERE a < 3; +SELECT pg_logical_emit_message(false, 'wal2json', 'this non-transactional message will be delivered even if you rollback the transaction'); + +INSERT INTO table3_without_pk (b, c) VALUES(2.34, 'Tapir'); -- it is not added to stream because there isn't a pk or a replica identity -UPDATE table2_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +UPDATE table3_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; -SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'format-version', '2'); +SELECT data FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'format-version', '2', 'add-msg-prefixes', 'wal2json'); SELECT 'stop' FROM pg_drop_replication_slot('test_slot'); + +DROP TABLE table3_with_pk; +DROP TABLE table3_without_pk; ``` The script above produces the output below: @@ -400,20 +468,27 @@ BEGIN INSERT 0 1 INSERT 0 1 INSERT 0 1 +3/78CB8F30 +3/78CB8F88 DELETE 2 +3/78CB90B8 INSERT 0 1 UPDATE 1 COMMIT -psql:/tmp/example3.sql:17: WARNING: no tuple identifier for UPDATE in table "public"."table2_without_pk" +psql:/tmp/example3.sql:20: WARNING: no tuple identifier for UPDATE in table "public"."table3_without_pk" +{"action":"M","transactional":false,"prefix":"wal2json","content":"this non-transactional message will be delivered even if you rollback the transaction"} {"action":"B"} -{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"character varying(30)","value":"Backup and Restore"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} -{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"character varying(30)","value":"Tuning"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} -{"action":"I","schema":"public","table":"table2_with_pk","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"character varying(30)","value":"Replication"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} -{"action":"D","schema":"public","table":"table2_with_pk","identity":[{"name":"a","type":"integer","value":1},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} -{"action":"D","schema":"public","table":"table2_with_pk","identity":[{"name":"a","type":"integer","value":2},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} -{"action":"I","schema":"public","table":"table2_without_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"numeric(5,2)","value":2.34},{"name":"c","type":"text","value":"Tapir"}]} +{"action":"I","schema":"public","table":"table3_with_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"character varying(30)","value":"Backup and Restore"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table3_with_pk","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"character varying(30)","value":"Tuning"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table3_with_pk","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"character varying(30)","value":"Replication"},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"M","transactional":true,"prefix":"wal2json","content":"this message will be delivered"} +{"action":"D","schema":"public","table":"table3_with_pk","identity":[{"name":"a","type":"integer","value":1},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"D","schema":"public","table":"table3_with_pk","identity":[{"name":"a","type":"integer","value":2},{"name":"c","type":"timestamp without time zone","value":"2019-12-29 04:58:34.806671"}]} +{"action":"I","schema":"public","table":"table3_without_pk","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"numeric(5,2)","value":2.34},{"name":"c","type":"text","value":"Tapir"}]} {"action":"C"} stop +DROP TABLE +DROP TABLE ``` License From a93c9db89e833b7a68ffe690e28e22f43e7ec45b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 21 Nov 2020 15:27:37 -0300 Subject: [PATCH 107/154] Fix table names in the example I renamed the tables in the first example but forgot to change the script. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c1b3ac357b40..5387f16d175f 100644 --- a/README.md +++ b/README.md @@ -161,21 +161,21 @@ In another terminal: ``` $ cat /tmp/example1.sql -CREATE TABLE table_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); -CREATE TABLE table_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); +CREATE TABLE table1_with_pk (a SERIAL, b VARCHAR(30), c TIMESTAMP NOT NULL, PRIMARY KEY(a, c)); +CREATE TABLE table1_without_pk (a SERIAL, b NUMERIC(5,2), c TEXT); BEGIN; -INSERT INTO table_with_pk (b, c) VALUES('Backup and Restore', now()); -INSERT INTO table_with_pk (b, c) VALUES('Tuning', now()); -INSERT INTO table_with_pk (b, c) VALUES('Replication', now()); +INSERT INTO table1_with_pk (b, c) VALUES('Backup and Restore', now()); +INSERT INTO table1_with_pk (b, c) VALUES('Tuning', now()); +INSERT INTO table1_with_pk (b, c) VALUES('Replication', now()); SELECT pg_logical_emit_message(true, 'wal2json', 'this message will be delivered'); SELECT pg_logical_emit_message(true, 'pgoutput', 'this message will be filtered'); -DELETE FROM table_with_pk WHERE a < 3; +DELETE FROM table1_with_pk WHERE a < 3; SELECT pg_logical_emit_message(false, 'wal2json', 'this non-transactional message will be delivered even if you rollback the transaction'); -INSERT INTO table_without_pk (b, c) VALUES(2.34, 'Tapir'); +INSERT INTO table1_without_pk (b, c) VALUES(2.34, 'Tapir'); -- it is not added to stream because there isn't a pk or a replica identity -UPDATE table_without_pk SET c = 'Anta' WHERE c = 'Tapir'; +UPDATE table1_without_pk SET c = 'Anta' WHERE c = 'Tapir'; COMMIT; DROP TABLE table1_with_pk; From f3650d71f972152c9c6a23a8d5ec84290bf3e4f1 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 7 Dec 2020 09:45:02 -0300 Subject: [PATCH 108/154] Remove unused code --- wal2json.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wal2json.c b/wal2json.c index 1c611d7eccbf..30c721d59249 100644 --- a/wal2json.c +++ b/wal2json.c @@ -870,14 +870,6 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; -#if PG_VERSION_NUM >= 130000 - if (rbtxn_has_catalog_changes(txn)) -#else - if (txn->has_catalog_changes) -#endif - elog(DEBUG2, "txn has catalog changes: yes"); - else - elog(DEBUG2, "txn has catalog changes: no"); elog(DEBUG2, "my change counter: " UINT64_FORMAT " ; # of changes: " UINT64_FORMAT " ; # of changes in memory: " UINT64_FORMAT, data->nr_changes, txn->nentries, txn->nentries_mem); elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); From 8139a6dbf1d78e62d44ab8ef0cddf186ffcc2c4e Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 7 Dec 2020 09:43:11 -0300 Subject: [PATCH 109/154] Don't rely on index attribute names for primary key If you rename a column that is part of the primary key, the attname for the primary key index isn't renamed. Someone could argue that it is a Postgres bug (I think it is a catalog inconsistency that could probably be fixed eventually) but it seems the cure is worse than the disease (see [1]). The code was refactored to avoid comparison by attribute name, instead it uses RelationGetIndexAttrBitmap() that obtains a bitmap of index attribute numbers based on its kind (primary key, identity, ...). Closes #11 [1] https://www.postgresql.org/message-id/CAA8M49r%3D1XoE27tQ08sAPhft_ayBu4Vvib%2BubwX4SRqtUGJ%2B3g%40mail.gmail.com --- Makefile | 2 +- expected/rename_column.out | 323 +++++++++++++++++++++++++++++++++++++ sql/rename_column.sql | 63 ++++++++ wal2json.c | 213 +++++------------------- 4 files changed, 428 insertions(+), 173 deletions(-) create mode 100644 expected/rename_column.out create mode 100644 sql/rename_column.sql diff --git a/Makefile b/Makefile index c9c6d4f95c6c..43d324cfbfd6 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - include_domain_data_type truncate actions position default pk + include_domain_data_type truncate actions position default pk rename_column PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/rename_column.out b/expected/rename_column.out new file mode 100644 index 000000000000..9e8d5b004236 --- /dev/null +++ b/expected/rename_column.out @@ -0,0 +1,323 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; +CREATE TABLE w2j_rename_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3), +PRIMARY KEY(a, d) +); +CREATE TABLE w2j_rename_ri ( +a int NOT NULL, +b timestamp, +c text, +d boolean NOT NULL, +e numeric(5,3) +); +CREATE UNIQUE INDEX w2j_rename_ri_idx ON w2j_rename_ri (a, d); +ALTER TABLE w2j_rename_ri REPLICA IDENTITY USING INDEX w2j_rename_ri_idx; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_rename_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_rename_pk SET e = 8.76 WHERE a = 123; +ALTER TABLE w2j_rename_pk RENAME COLUMN d TO f; +INSERT INTO w2j_rename_pk (a, b, c, f, e) VALUES(456, '2020-12-07 15:56:59', 'Panthera Onca', false, 4.44); +UPDATE w2j_rename_pk SET e = 2.718 WHERE a = 456; +BEGIN; +INSERT INTO w2j_rename_pk (a, b, c, f, e) VALUES(789, '2021-04-04 10:33:04', 'Chrysocyon brachyurus', true, 20.30); +ALTER TABLE w2j_rename_pk RENAME COLUMN a TO g; +INSERT INTO w2j_rename_pk (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'Myrmecophaga tridactyla', false, 1.8); +UPDATE w2j_rename_pk SET e = 3.1415 WHERE g = 456; +COMMIT; +INSERT INTO w2j_rename_ri (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_rename_ri SET e = 8.76 WHERE a = 123; +ALTER TABLE w2j_rename_ri RENAME COLUMN d TO f; +INSERT INTO w2j_rename_ri (a, b, c, f, e) VALUES(456, '2020-12-07 15:56:59', 'Panthera Onca', false, 4.44); +UPDATE w2j_rename_ri SET e = 2.718 WHERE a = 456; +BEGIN; +INSERT INTO w2j_rename_ri (a, b, c, f, e) VALUES(789, '2021-04-04 10:33:04', 'Chrysocyon brachyurus', true, 20.30); +ALTER TABLE w2j_rename_ri RENAME COLUMN a TO g; +INSERT INTO w2j_rename_ri (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'Myrmecophaga tridactyla', false, 1.8); +UPDATE w2j_rename_ri SET e = 3.1415 WHERE g = 456; +COMMIT; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); + data +--------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560], + + "pk": { + + "pknames": ["a", "d"], + + "pktypes": ["int4", "bool"] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + + "pk": { + + "pknames": ["a", "d"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["a", "d"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [123, true] + + } + + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["a", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800],+ + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ,{ + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["g", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + + "oldkeys": { + + "keynames": ["a", "d"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [123, true] + + } + + } + + ] + + } + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440] + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + + "oldkeys": { + + "keynames": ["a", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800] + + } + + ,{ + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + + "oldkeys": { + + "keynames": ["g", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + + } +(12 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[{"name":"a","type":"integer"},{"name":"d","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.760}],"identity":[{"name":"a","type":"integer","value":123},{"name":"d","type":"boolean","value":true}],"pk":[{"name":"a","type":"integer"},{"name":"d","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":4.440}],"pk":[{"name":"a","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":2.718}],"identity":[{"name":"a","type":"integer","value":456},{"name":"f","type":"boolean","value":false}],"pk":[{"name":"a","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":789},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 04 10:33:04 2021"},{"name":"c","type":"text","value":"Chrysocyon brachyurus"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":20.300}],"pk":[{"name":"a","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"g","type":"integer","value":790},{"name":"b","type":"timestamp without time zone","value":"Sat Apr 04 10:34:55 2020"},{"name":"c","type":"text","value":"Myrmecophaga tridactyla"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":1.800}],"pk":[{"name":"g","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"U","schema":"public","table":"w2j_rename_pk","columns":[{"name":"g","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":3.142}],"identity":[{"name":"g","type":"integer","value":456},{"name":"f","type":"boolean","value":false}],"pk":[{"name":"g","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_ri","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_rename_ri","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.760}],"identity":[{"name":"a","type":"integer","value":123},{"name":"d","type":"boolean","value":true}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_ri","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":4.440}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_rename_ri","columns":[{"name":"a","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":2.718}],"identity":[{"name":"a","type":"integer","value":456},{"name":"f","type":"boolean","value":false}],"pk":[]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_ri","columns":[{"name":"a","type":"integer","value":789},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 04 10:33:04 2021"},{"name":"c","type":"text","value":"Chrysocyon brachyurus"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":20.300}],"pk":[]} + {"action":"I","schema":"public","table":"w2j_rename_ri","columns":[{"name":"g","type":"integer","value":790},{"name":"b","type":"timestamp without time zone","value":"Sat Apr 04 10:34:55 2020"},{"name":"c","type":"text","value":"Myrmecophaga tridactyla"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":1.800}],"pk":[]} + {"action":"U","schema":"public","table":"w2j_rename_ri","columns":[{"name":"g","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":3.142}],"identity":[{"name":"g","type":"integer","value":456},{"name":"f","type":"boolean","value":false}],"pk":[]} + {"action":"C"} +(38 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE w2j_rename_pk; +DROP TABLE w2j_rename_ri; diff --git a/sql/rename_column.sql b/sql/rename_column.sql new file mode 100644 index 000000000000..2443baa60388 --- /dev/null +++ b/sql/rename_column.sql @@ -0,0 +1,63 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; + +CREATE TABLE w2j_rename_pk ( +a int, +b timestamp, +c text, +d boolean, +e numeric(5,3), +PRIMARY KEY(a, d) +); + +CREATE TABLE w2j_rename_ri ( +a int NOT NULL, +b timestamp, +c text, +d boolean NOT NULL, +e numeric(5,3) +); +CREATE UNIQUE INDEX w2j_rename_ri_idx ON w2j_rename_ri (a, d); +ALTER TABLE w2j_rename_ri REPLICA IDENTITY USING INDEX w2j_rename_ri_idx; + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO w2j_rename_pk (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_rename_pk SET e = 8.76 WHERE a = 123; + +ALTER TABLE w2j_rename_pk RENAME COLUMN d TO f; + +INSERT INTO w2j_rename_pk (a, b, c, f, e) VALUES(456, '2020-12-07 15:56:59', 'Panthera Onca', false, 4.44); +UPDATE w2j_rename_pk SET e = 2.718 WHERE a = 456; + +BEGIN; +INSERT INTO w2j_rename_pk (a, b, c, f, e) VALUES(789, '2021-04-04 10:33:04', 'Chrysocyon brachyurus', true, 20.30); +ALTER TABLE w2j_rename_pk RENAME COLUMN a TO g; +INSERT INTO w2j_rename_pk (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'Myrmecophaga tridactyla', false, 1.8); +UPDATE w2j_rename_pk SET e = 3.1415 WHERE g = 456; +COMMIT; + +INSERT INTO w2j_rename_ri (a, b, c, d, e) VALUES(123, '2020-04-26 16:23:59', 'Melanosuchus Niger', true, 4.56); +UPDATE w2j_rename_ri SET e = 8.76 WHERE a = 123; + +ALTER TABLE w2j_rename_ri RENAME COLUMN d TO f; + +INSERT INTO w2j_rename_ri (a, b, c, f, e) VALUES(456, '2020-12-07 15:56:59', 'Panthera Onca', false, 4.44); +UPDATE w2j_rename_ri SET e = 2.718 WHERE a = 456; + +BEGIN; +INSERT INTO w2j_rename_ri (a, b, c, f, e) VALUES(789, '2021-04-04 10:33:04', 'Chrysocyon brachyurus', true, 20.30); +ALTER TABLE w2j_rename_ri RENAME COLUMN a TO g; +INSERT INTO w2j_rename_ri (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'Myrmecophaga tridactyla', false, 1.8); +UPDATE w2j_rename_ri SET e = 3.1415 WHERE g = 456; +COMMIT; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE w2j_rename_pk; +DROP TABLE w2j_rename_ri; diff --git a/wal2json.c b/wal2json.c index 30c721d59249..1285e0abfa2d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -14,6 +14,7 @@ #include "access/genam.h" #include "access/heapam.h" +#include "access/sysattr.h" #include "catalog/indexing.h" #include "catalog/pg_attrdef.h" #include "catalog/pg_type.h" @@ -135,8 +136,9 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, #endif static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Oid reloid); -static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool addcomma, Oid reloid); -static void pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool addcomma); +static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Oid reloid); +static void pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool addcomma); +static void identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs); static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); static bool string_to_SelectTable(char *rawstring, char separator, List **select_tables); static bool split_string_to_list(char *rawstring, char separator, List **sl); @@ -943,7 +945,7 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, * replident: is this tuple a replica identity? */ static void -tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool replident, bool addcomma, Oid reloid) +tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Oid reloid) { JsonDecodingData *data; int natt; @@ -1041,32 +1043,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (attr->attisdropped || attr->attnum < 0) continue; - /* Search indexed columns in whole heap tuple */ - if (indexdesc != NULL) - { - int j; - bool found_col = false; - - for (j = 0; j < indexdesc->natts; j++) - { - Form_pg_attribute iattr; - - /* See explanation a few lines above. */ -#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) - iattr = indexdesc->attrs[j]; -#else - iattr = TupleDescAttr(indexdesc, j); -#endif - - if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) - found_col = true; - - } - - /* Print only indexed columns */ - if (!found_col) - continue; - } + /* Replica identity column? */ + if (bs != NULL && !bms_is_member(attr->attnum - FirstLowInvalidHeapAttributeNumber, bs)) + continue; /* Get Datum from tuple */ origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); @@ -1362,15 +1341,15 @@ columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple /* Print replica identity information */ static void -identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc) +identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs) { /* Last parameter does not matter */ - tuple_to_stringinfo(ctx, tupdesc, tuple, indexdesc, true, false, InvalidOid); + tuple_to_stringinfo(ctx, tupdesc, tuple, bs, true, false, InvalidOid); } /* Print primary key information */ static void -pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, TupleDesc indexdesc, bool addcomma) +pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool addcomma) { JsonDecodingData *data; int natt; @@ -1381,10 +1360,6 @@ pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple data = ctx->output_plugin_private; - /* no primary key */ - if (indexdesc == NULL) - return; - initStringInfo(&pknames); initStringInfo(&pktypes); @@ -1414,31 +1389,9 @@ pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple if (attr->attisdropped || attr->attnum < 0) continue; - /* Search pk columns in whole heap tuple */ - if (indexdesc != NULL) - { - int j; - bool found_col = false; - - for (j = 0; j < indexdesc->natts; j++) - { - Form_pg_attribute iattr; - - /* See explanation a few lines above. */ -#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) - iattr = indexdesc->attrs[j]; -#else - iattr = TupleDescAttr(indexdesc, j); -#endif - - if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) - found_col = true; - } - - /* Print only indexed columns */ - if (!found_col) - continue; - } + /* Primary key column? */ + if (bs != NULL && !bms_is_member(attr->attnum - FirstLowInvalidHeapAttributeNumber, bs)) + continue; typid = attr->atttypid; @@ -1539,11 +1492,8 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, TupleDesc tupdesc; MemoryContext old; - Relation indexrel; - TupleDesc indexdesc; - - Relation pkrel = NULL; - TupleDesc pkdesc = NULL; + Bitmapset *pkbs = NULL; + Bitmapset *ribs = NULL; char *schemaname; char *tablename; @@ -1751,30 +1701,21 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfo(ctx->out, ",%s", data->nl); if (data->include_pk) - { #if PG_VERSION_NUM >= 100000 - if (OidIsValid(relation->rd_pkindex)) /* 10+ */ - { - pkrel = RelationIdGetRelation(relation->rd_pkindex); - pkdesc = RelationGetDescr(pkrel); - } + pkbs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_PRIMARY_KEY); #else - if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) - { - pkrel = RelationIdGetRelation(relation->rd_replidindex); - pkdesc = RelationGetDescr(pkrel); - } + pkbs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_KEY); #endif - } switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: /* Print the new tuple */ - if (data->include_pk && pkrel != NULL) + if (data->include_pk && OidIsValid(relation->rd_replidindex) && + relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) { columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); - pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, false); + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, false); } else { @@ -1784,8 +1725,9 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); - if (data->include_pk && pkrel != NULL) - pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, true); + if (data->include_pk && OidIsValid(relation->rd_replidindex) && + relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); /* * The old tuple is available when: @@ -1800,17 +1742,8 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { elog(DEBUG1, "old tuple is null"); - indexrel = RelationIdGetRelation(relation->rd_replidindex); - if (indexrel != NULL) - { - indexdesc = RelationGetDescr(indexrel); - identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, indexdesc); - RelationClose(indexrel); - } - else - { - identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, NULL); - } + ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, ribs); } else { @@ -1819,21 +1752,12 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } break; case REORDER_BUFFER_CHANGE_DELETE: - if (data->include_pk && pkrel != NULL) - pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkdesc, true); + if (data->include_pk && OidIsValid(relation->rd_replidindex) && + relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); - /* Print the replica identity */ - indexrel = RelationIdGetRelation(relation->rd_replidindex); - if (indexrel != NULL) - { - indexdesc = RelationGetDescr(indexrel); - identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, indexdesc); - RelationClose(indexrel); - } - else - { - identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, NULL); - } + ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); + identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, ribs); if (change->data.tp.oldtuple == NULL) elog(DEBUG1, "old tuple is null"); @@ -1844,8 +1768,8 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } - if (data->include_pk && pkrel != NULL) - RelationClose(pkrel); + bms_free(pkbs); + bms_free(ribs); appendStringInfo(ctx->out, "%s%s}", data->ht, data->ht); @@ -1944,8 +1868,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple JsonDecodingData *data; TupleDesc tupdesc; Relation defrel = NULL; - Relation idxrel; - TupleDesc idxdesc = NULL; + Bitmapset *bs = NULL; int i; Datum *values; bool *nulls; @@ -1963,41 +1886,14 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple /* figure out replica identity columns */ if (kind == PGOUTPUTJSON_IDENTITY) { - if (OidIsValid(relation->rd_replidindex)) /* REPLICA IDENTITY INDEX */ - { - idxrel = RelationIdGetRelation(relation->rd_replidindex); - idxdesc = RelationGetDescr(idxrel); - } -#if PG_VERSION_NUM >= 100000 - else if (OidIsValid(relation->rd_pkindex)) /* REPLICA IDENTITY DEFAULT + PK (10+) */ - { - idxrel = RelationIdGetRelation(relation->rd_pkindex); - idxdesc = RelationGetDescr(idxrel); - } -#else - else if (relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT && OidIsValid(relation->rd_replidindex)) /* 9.4, 9.5 and 9.6 */ - { - idxrel = RelationIdGetRelation(relation->rd_replidindex); - idxdesc = RelationGetDescr(idxrel); - } -#endif - else if (relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL) - elog(ERROR, "table does not have primary key or replica identity"); + bs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); } else if (kind == PGOUTPUTJSON_PK) { #if PG_VERSION_NUM >= 100000 - if (OidIsValid(relation->rd_pkindex)) /* 10+ */ - { - idxrel = RelationIdGetRelation(relation->rd_pkindex); - idxdesc = RelationGetDescr(idxrel); - } + bs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_PRIMARY_KEY); #else - if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) - { - idxrel = RelationIdGetRelation(relation->rd_replidindex); - idxdesc = RelationGetDescr(idxrel); - } + bs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_KEY); #endif } @@ -2014,9 +1910,6 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple for (i = 0; i < tupdesc->natts; i++) { Form_pg_attribute attr; - int j; - bool found = false; - char *type_str; #if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) attr = tupdesc->attrs[i]; @@ -2028,40 +1921,13 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple if (attr->attisdropped || attr->attnum < 0) continue; - /* - * oldtuple contains NULL on those values that are not defined by - * REPLICA IDENTITY. In this case, print only non-null values. - */ - if (nulls[i] && (kind == PGOUTPUTJSON_PK || kind == PGOUTPUTJSON_IDENTITY)) + if (bs != NULL && !bms_is_member(attr->attnum - FirstLowInvalidHeapAttributeNumber, bs)) continue; /* don't send unchanged TOAST Datum */ if (!nulls[i] && attr->attlen == -1 && VARATT_IS_EXTERNAL_ONDISK(values[i])) continue; - /* - * Is it replica identity column? Print only those columns or all - * columns if REPLICA IDENTITY FULL is set. - */ - if (kind == PGOUTPUTJSON_PK || (kind == PGOUTPUTJSON_IDENTITY && relation->rd_rel->relreplident != REPLICA_IDENTITY_FULL)) - { - for (j = 0; j < idxdesc->natts; j++) - { - Form_pg_attribute iattr; - -#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 90605) || (PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90509) || (PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 90414) - iattr = idxdesc->attrs[j]; -#else - iattr = TupleDescAttr(idxdesc, j); -#endif - if (strcmp(NameStr(attr->attname), NameStr(iattr->attname)) == 0) - found = true; - } - - if (!found) - continue; - } - if (need_sep) appendStringInfoChar(ctx->out, ','); need_sep = true; @@ -2075,6 +1941,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple { HeapTuple type_tuple; Form_pg_type type_form; + char *type_str; type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(attr->atttypid)); type_form = (Form_pg_type) GETSTRUCT(type_tuple); @@ -2202,6 +2069,8 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple #endif } + bms_free(bs); + pfree(values); pfree(nulls); } From a96dd31fdf464935febdb9f862ab6f064abd511a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 25 Apr 2021 22:18:03 -0300 Subject: [PATCH 110/154] Combine common code into functions Instead of repeating code into different wal2json format output functions, combine the common code into functions and use them. --- wal2json.c | 241 ++++++++++++++++++++++------------------------------- 1 file changed, 101 insertions(+), 140 deletions(-) diff --git a/wal2json.c b/wal2json.c index 1285e0abfa2d..daa78e12705b 100644 --- a/wal2json.c +++ b/wal2json.c @@ -144,6 +144,10 @@ static bool string_to_SelectTable(char *rawstring, char separator, List **select static bool split_string_to_list(char *rawstring, char separator, List **sl); static bool split_string_to_oid_list(char *rawstring, char separator, List **sl); +static bool pg_filter_by_action(int change_type, JsonAction actions); +static bool pg_filter_by_table(List *filter_tables, char *schemaname, char *tablename); +static bool pg_add_by_table(List *add_tables, char *schemaname, char *tablename); + /* version 1 */ static void pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn); @@ -1468,6 +1472,83 @@ pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple pfree(pktypes.data); } +static bool +pg_filter_by_action(int change_type, JsonAction actions) +{ + if (change_type == REORDER_BUFFER_CHANGE_INSERT && !actions.insert) + { + elog(DEBUG3, "ignore INSERT"); + return true; + } + if (change_type == REORDER_BUFFER_CHANGE_UPDATE && !actions.update) + { + elog(DEBUG3, "ignore UPDATE"); + return true; + } + if (change_type == REORDER_BUFFER_CHANGE_DELETE && !actions.delete) + { + elog(DEBUG3, "ignore DELETE"); + return true; + } + + return false; +} + +static bool +pg_filter_by_table(List *filter_tables, char *schemaname, char *tablename) +{ + if (list_length(filter_tables) > 0) + { + ListCell *lc; + + foreach(lc, filter_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was filtered out", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + return true; + } + } + } + } + + return false; +} + +static bool +pg_add_by_table(List *add_tables, char *schemaname, char *tablename) +{ + if (list_length(add_tables) > 0) + { + ListCell *lc; + + /* all tables in all schemas are added by default */ + foreach(lc, add_tables) + { + SelectTable *t = lfirst(lc); + + if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) + { + if (t->alltables || strcmp(t->tablename, tablename) == 0) + { + elog(DEBUG2, "\"%s\".\"%s\" was added", + ((t->allschemas) ? "*" : t->schemaname), + ((t->alltables) ? "*" : t->tablename)); + return true; + } + } + } + } + + return false; +} + /* Callback for individual changed tuples */ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -1502,21 +1583,9 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, data = ctx->output_plugin_private; - if (change->action == REORDER_BUFFER_CHANGE_INSERT && !data->actions.insert) - { - elog(DEBUG3, "ignore INSERT"); - return; - } - if (change->action == REORDER_BUFFER_CHANGE_UPDATE && !data->actions.update) - { - elog(DEBUG3, "ignore UPDATE"); + /* filter changes by action */ + if (pg_filter_by_action(change->action, data->actions)) return; - } - if (change->action == REORDER_BUFFER_CHANGE_DELETE && !data->actions.delete) - { - elog(DEBUG3, "ignore DELETE"); - return; - } class_form = RelationGetForm(relation); tupdesc = RelationGetDescr(relation); @@ -1535,69 +1604,21 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, RelationGetIndexList(relation); /* Filter tables, if available */ - if (list_length(data->filter_tables) > 0) + if (pg_filter_by_table(data->filter_tables, schemaname, tablename)) { - ListCell *lc; - bool skip = false; - - foreach(lc, data->filter_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was filtered out", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = true; - } - } - } - - /* table was found */ - if (skip) - { - MemoryContextSwitchTo(old); - MemoryContextReset(data->context); - return; - } + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; } /* Add tables */ - if (list_length(data->add_tables) > 0) + if (!pg_add_by_table(data->add_tables, schemaname, tablename)) { - ListCell *lc; - bool skip = true; - - /* all tables in all schemas are added by default */ - foreach(lc, data->add_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was added", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = false; - } - } - } - - /* table was not found */ - if (skip) - { - MemoryContextSwitchTo(old); - MemoryContextReset(data->context); - return; - } + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; } - /* Sanity checks */ switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: @@ -2083,7 +2104,6 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat /* make sure rd_pkindex and rd_replidindex are set */ RelationGetIndexList(relation); - /* sanity checks */ switch (change->action) { case REORDER_BUFFER_CHANGE_INSERT: @@ -2266,21 +2286,9 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, char *schemaname; char *tablename; - if (change->action == REORDER_BUFFER_CHANGE_INSERT && !data->actions.insert) - { - elog(DEBUG3, "ignore INSERT"); - return; - } - if (change->action == REORDER_BUFFER_CHANGE_UPDATE && !data->actions.update) - { - elog(DEBUG3, "ignore UPDATE"); + /* filter changes by action */ + if (pg_filter_by_action(change->action, data->actions)) return; - } - if (change->action == REORDER_BUFFER_CHANGE_DELETE && !data->actions.delete) - { - elog(DEBUG3, "ignore DELETE"); - return; - } /* avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); @@ -2290,66 +2298,19 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, tablename = RelationGetRelationName(relation); /* Exclude tables, if available */ - if (list_length(data->filter_tables) > 0) + if (pg_filter_by_table(data->filter_tables, schemaname, tablename)) { - ListCell *lc; - bool skip = false; - - foreach(lc, data->filter_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was filtered out", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = true; - } - } - } - - /* table was found */ - if (skip) - { - MemoryContextSwitchTo(old); - MemoryContextReset(data->context); - return; - } + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; } /* Add tables */ - if (list_length(data->add_tables) > 0) + if (!pg_add_by_table(data->add_tables, schemaname, tablename)) { - ListCell *lc; - bool skip = true; - - /* all tables in all schemas are added by default */ - foreach(lc, data->add_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was added", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = false; - } - } - } - - /* table was not found */ - if (skip) - { - MemoryContextSwitchTo(old); - MemoryContextReset(data->context); - return; - } + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + return; } pg_decode_write_change(ctx, txn, relation, change); From 1527dfc56a54d5b7c15b2fb6ec2ab8d7776402ec Mon Sep 17 00:00:00 2001 From: Michael Hauser-Raspe Date: Thu, 26 Nov 2020 11:19:22 +0000 Subject: [PATCH 111/154] Add docs on include-origin option. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5387f16d175f..ab7468ff0a26 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Parameters * `include-type-oids`: add type oids. Default is _false_. * `include-domain-data-type`: replace domain name with the underlying data type. Default is _false_. * `include-column-positions`: add column position (_pg_attribute.attnum_). Default is _false_. +* `include-origin`: add origin of a piece of data. Default is _false_. * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. * `include-default`: add default expression. Default is _false_. * `include-pk`: add _primary key_ information as _pk_. Column name and data type is included. Default is _false_. From 4548fd3f08110da15c8d1cda18f297668b8ecc8a Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Fri, 20 Aug 2021 18:41:57 -0500 Subject: [PATCH 112/154] document include-transaction option --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ab7468ff0a26..939f167027bc 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ Parameters * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. +* `include-transaction`: emit records denoting the start and end of each transaction. Default is _true_. * `include-unchanged-toast` (deprecated): Don't use it. It is deprecated. * `filter-origins`: exclude changes from the specified origins. Default is empty which means that no origin will be filtered. It is a comma separated value. * `filter-tables`: exclude rows from the specified tables. Default is empty which means that no table will be filtered. It is a comma separated value. The tables should be schema-qualified. `*.foo` means table foo in all schemas and `bar.*` means all tables in schema bar. Special characters (space, single quote, comma, period, asterisk) must be escaped with backslash. Schema and table are case-sensitive. Table `"public"."Foo bar"` should be specified as `public.Foo\ bar`. From ef1da1f54bc992a6716ea84c8e083e07b72c96a9 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 22 Aug 2021 10:38:11 -0300 Subject: [PATCH 113/154] Filter is not applied for TRUNCATE Filter is failing to exclude tables that matchs the filter. Filter code was refactored at commit a96dd31fdf464935febdb9f862ab6f064abd511a but I forgot to replace the filter in the truncate function. I include a regression test to cover this code. --- expected/truncate.out | 35 +++++++++++++++++++++-- sql/truncate.sql | 7 +++++ wal2json.c | 66 ++++++++++++++++--------------------------- 3 files changed, 64 insertions(+), 44 deletions(-) diff --git a/expected/truncate.out b/expected/truncate.out index ad5ad4db745f..4d8b965971d5 100644 --- a/expected/truncate.out +++ b/expected/truncate.out @@ -5,6 +5,8 @@ CREATE TABLE table_truncate_1 (a integer, b text); CREATE TABLE table_truncate_2 (a integer, b text); CREATE TABLE table_truncate_3 (a integer, b text); CREATE TABLE table_truncate_4 (a integer, b text); +CREATE TABLE table_truncate_5 (a integer, b text); +CREATE TABLE table_truncate_6 (a integer, b text); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- @@ -22,6 +24,9 @@ COMMIT; BEGIN; TRUNCATE table_truncate_4; ROLLBACK; +BEGIN; +TRUNCATE table_truncate_5, table_truncate_6; +COMMIT; SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); data ------------------------------------------------------------- @@ -57,7 +62,11 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } + ] + } -(2 rows) + { + + "change": [ + + ] + + } +(3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); data @@ -72,7 +81,29 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"action":"T","schema":"public","table":"table_truncate_3"} {"action":"I","schema":"public","table":"table_truncate_3","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"text","value":"test3"}]} {"action":"C"} -(10 rows) + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_5"} + {"action":"T","schema":"public","table":"table_truncate_6"} + {"action":"C"} +(14 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-tables', '*.table_truncate_5'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------ + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_1"} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_2"} + {"action":"I","schema":"public","table":"table_truncate_1","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"test1"}]} + {"action":"I","schema":"public","table":"table_truncate_3","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"text","value":"test2"}]} + {"action":"T","schema":"public","table":"table_truncate_3"} + {"action":"I","schema":"public","table":"table_truncate_3","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"text","value":"test3"}]} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"table_truncate_6"} + {"action":"C"} +(13 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/truncate.sql b/sql/truncate.sql index 121b735f1903..0accc3b5a143 100644 --- a/sql/truncate.sql +++ b/sql/truncate.sql @@ -6,6 +6,8 @@ CREATE TABLE table_truncate_1 (a integer, b text); CREATE TABLE table_truncate_2 (a integer, b text); CREATE TABLE table_truncate_3 (a integer, b text); CREATE TABLE table_truncate_4 (a integer, b text); +CREATE TABLE table_truncate_5 (a integer, b text); +CREATE TABLE table_truncate_6 (a integer, b text); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); @@ -23,6 +25,11 @@ BEGIN; TRUNCATE table_truncate_4; ROLLBACK; +BEGIN; +TRUNCATE table_truncate_5, table_truncate_6; +COMMIT; + SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'filter-tables', '*.table_truncate_5'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index daa78e12705b..056fa02758cf 100644 --- a/wal2json.c +++ b/wal2json.c @@ -2555,6 +2555,22 @@ static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, /* Avoid leaking memory by using and resetting our own context */ old = MemoryContextSwitchTo(data->context); + /* Exclude tables, if available */ + if (pg_filter_by_table(data->filter_tables, schemaname, tablename)) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + continue; + } + + /* Add tables */ + if (!pg_add_by_table(data->add_tables, schemaname, tablename)) + { + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + continue; + } + if (data->write_in_chunks) OutputPluginPrepareWrite(ctx, true); @@ -2641,53 +2657,19 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, tablename = RelationGetRelationName(relations[i]); /* Exclude tables, if available */ - if (list_length(data->filter_tables) > 0) + if (pg_filter_by_table(data->filter_tables, schemaname, tablename)) { - ListCell *lc; - - foreach(lc, data->filter_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was filtered out", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - continue; - } - } - } + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + continue; } /* Add tables */ - if (list_length(data->add_tables) > 0) + if (!pg_add_by_table(data->add_tables, schemaname, tablename)) { - ListCell *lc; - bool skip = true; - - /* all tables in all schemas are added by default */ - foreach(lc, data->add_tables) - { - SelectTable *t = lfirst(lc); - - if (t->allschemas || strcmp(t->schemaname, schemaname) == 0) - { - if (t->alltables || strcmp(t->tablename, tablename) == 0) - { - elog(DEBUG2, "\"%s\".\"%s\" was added", - ((t->allschemas) ? "*" : t->schemaname), - ((t->alltables) ? "*" : t->tablename)); - skip = false; - } - } - } - - /* table was not found */ - if (skip) - continue; + MemoryContextSwitchTo(old); + MemoryContextReset(data->context); + continue; } OutputPluginPrepareWrite(ctx, true); From c79a225041cfae566b92177b86635bb48047229f Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 22 Aug 2021 10:27:38 -0300 Subject: [PATCH 114/154] Avoid duplicate double quotes for type names When an internal function already returns a type name with double quotes, doesn't add another one. Fix #200 --- expected/include_domain_data_type.out | 68 +++++++++++++++++---------- sql/include_domain_data_type.sql | 20 ++++---- wal2json.c | 30 ++++++++++-- 3 files changed, 79 insertions(+), 39 deletions(-) diff --git a/expected/include_domain_data_type.out b/expected/include_domain_data_type.out index c738fb4e3ca6..c4d800f561a4 100644 --- a/expected/include_domain_data_type.out +++ b/expected/include_domain_data_type.out @@ -2,22 +2,22 @@ -- predictability SET synchronous_commit = on; SET extra_float_digits = 0; -CREATE DOMAIN wal2json_domain_1 AS bigint; +CREATE DOMAIN "wal2json_DOMAIN_1" AS bigint; CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); CREATE DOMAIN wal2json_domain_3 AS varchar(30); -CREATE DOMAIN wal2json_domain_4 AS bit varying(20); +CREATE DOMAIN "wal2json_DOMAIN_4" AS bit varying(20); CREATE TABLE test_wal2json_5 ( a smallserial, b smallint, c int, -d wal2json_domain_1, +d "wal2json_DOMAIN_1", e wal2json_domain_2, f real not null, g double precision, h char(10), i wal2json_domain_3, j text, -k wal2json_domain_4, +k "wal2json_DOMAIN_4", l timestamp, m date, n boolean not null, @@ -33,7 +33,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); UPDATE test_wal2json_5 SET f = -f WHERE b = 1; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-pk', '1'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + @@ -43,8 +43,12 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "schema": "public", + "table": "test_wal2json_5", + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + - "columntypes": ["smallint", "smallint", "integer", "wal2json_domain_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ - "columnvalues": [1, 1, 2, "3", "3.540", 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + "columntypes": ["smallint", "smallint", "integer", "wal2json_DOMAIN_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_DOMAIN_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columnvalues": [1, 1, 2, "3", "3.540", 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "pk": { + + "pknames": ["b", "c", "d"], + + "pktypes": ["smallint", "integer", "wal2json_DOMAIN_1"] + + } + } + ] + } @@ -55,11 +59,15 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "schema": "public", + "table": "test_wal2json_5", + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + - "columntypes": ["smallint", "smallint", "integer", "wal2json_domain_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ + "columntypes": ["smallint", "smallint", "integer", "wal2json_DOMAIN_1", "wal2json_domain_2", "real", "double precision", "character(10)", "wal2json_domain_3", "text", "wal2json_DOMAIN_4", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ "columnvalues": [1, 1, 2, "3", "3.540", -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "pk": { + + "pknames": ["b", "c", "d"], + + "pktypes": ["smallint", "integer", "wal2json_DOMAIN_1"] + + }, + "oldkeys": { + "keynames": ["b", "c", "d"], + - "keytypes": ["smallint", "integer", "wal2json_domain_1"], + + "keytypes": ["smallint", "integer", "wal2json_DOMAIN_1"], + "keyvalues": [1, 2, "3"] + } + } + @@ -67,7 +75,7 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } (2 rows) -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-pk', '1'); data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { + @@ -78,7 +86,11 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "table": "test_wal2json_5", + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ - "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + + "columnvalues": [1, 1, 2, 3, 3.540, 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "pk": { + + "pknames": ["b", "c", "d"], + + "pktypes": ["smallint", "integer", "bigint"] + + } + } + ] + } @@ -91,6 +103,10 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + "columntypes": ["smallint", "smallint", "integer", "bigint", "numeric(5,3)", "real", "double precision", "character(10)", "character varying(30)", "text", "bit varying(20)", "timestamp without time zone", "date", "boolean", "json", "tsvector"],+ "columnvalues": [1, 1, 2, 3, 3.540, -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + + "pk": { + + "pknames": ["b", "c", "d"], + + "pktypes": ["smallint", "integer", "bigint"] + + }, + "oldkeys": { + "keynames": ["b", "c", "d"], + "keytypes": ["smallint", "integer", "bigint"], + @@ -111,7 +127,7 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "schema": "public", + "table": "test_wal2json_5", + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + - "columntypes": ["int2", "int2", "int4", "wal2json_domain_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp", "date", "bool", "json", "tsvector"],+ + "columntypes": ["int2", "int2", "int4", "wal2json_DOMAIN_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_DOMAIN_4", "timestamp", "date", "bool", "json", "tsvector"],+ "columnvalues": [1, 1, 2, "3", "3.540", 876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"] + } + ] + @@ -123,11 +139,11 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo "schema": "public", + "table": "test_wal2json_5", + "columnnames": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"], + - "columntypes": ["int2", "int2", "int4", "wal2json_domain_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_domain_4", "timestamp", "date", "bool", "json", "tsvector"],+ + "columntypes": ["int2", "int2", "int4", "wal2json_DOMAIN_1", "wal2json_domain_2", "float4", "float8", "bpchar", "wal2json_domain_3", "text", "wal2json_DOMAIN_4", "timestamp", "date", "bool", "json", "tsvector"],+ "columnvalues": [1, 1, 2, "3", "3.540", -876.563, 1.23, "teste ", "testando", "um texto longo", "001110010101010", "Sat Nov 02 17:30:52 2013", "02-04-2013", true, "{ \"a\": 123 }", "'Old' 'Parr'"], + "oldkeys": { + "keynames": ["b", "c", "d"], + - "keytypes": ["int2", "int4", "wal2json_domain_1"], + + "keytypes": ["int2", "int4", "wal2json_DOMAIN_1"], + "keyvalues": [1, 2, "3"] + } + } + @@ -169,25 +185,25 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } (2 rows) -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0'); - data ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0', 'include-pk', '1'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"action":"B"} - {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_domain_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_DOMAIN_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_DOMAIN_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"wal2json_DOMAIN_1"}]} {"action":"C"} {"action":"B"} - {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_domain_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_domain_1","value":"3"}]} + {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_DOMAIN_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_DOMAIN_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_DOMAIN_1","value":"3"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"wal2json_DOMAIN_1"}]} {"action":"C"} (6 rows) -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1'); - data ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1', 'include-pk', '1'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"action":"B"} - {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}]} + {"action":"I","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"bigint"}]} {"action":"C"} {"action":"B"} - {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"}]} + {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"bigint"}]} {"action":"C"} (6 rows) @@ -198,7 +214,7 @@ SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); (1 row) DROP TABLE test_wal2json_5; -DROP DOMAIN wal2json_domain_1; +DROP DOMAIN "wal2json_DOMAIN_1"; DROP DOMAIN wal2json_domain_2; DROP DOMAIN wal2json_domain_3; -DROP DOMAIN wal2json_domain_4; +DROP DOMAIN "wal2json_DOMAIN_4"; diff --git a/sql/include_domain_data_type.sql b/sql/include_domain_data_type.sql index 6d63309c0e88..ad1b9ec4388b 100644 --- a/sql/include_domain_data_type.sql +++ b/sql/include_domain_data_type.sql @@ -4,23 +4,23 @@ SET synchronous_commit = on; SET extra_float_digits = 0; -CREATE DOMAIN wal2json_domain_1 AS bigint; +CREATE DOMAIN "wal2json_DOMAIN_1" AS bigint; CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); CREATE DOMAIN wal2json_domain_3 AS varchar(30); -CREATE DOMAIN wal2json_domain_4 AS bit varying(20); +CREATE DOMAIN "wal2json_DOMAIN_4" AS bit varying(20); CREATE TABLE test_wal2json_5 ( a smallserial, b smallint, c int, -d wal2json_domain_1, +d "wal2json_DOMAIN_1", e wal2json_domain_2, f real not null, g double precision, h char(10), i wal2json_domain_3, j text, -k wal2json_domain_4, +k "wal2json_DOMAIN_4", l timestamp, m date, n boolean not null, @@ -35,16 +35,16 @@ INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES UPDATE test_wal2json_5 SET f = -f WHERE b = 1; -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-pk', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-pk', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-typmod', '0'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-typmod', '0'); -SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0'); -SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0', 'include-pk', '1'); +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1', 'include-pk', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); DROP TABLE test_wal2json_5; -DROP DOMAIN wal2json_domain_1; +DROP DOMAIN "wal2json_DOMAIN_1"; DROP DOMAIN wal2json_domain_2; DROP DOMAIN wal2json_domain_3; -DROP DOMAIN wal2json_domain_4; +DROP DOMAIN "wal2json_DOMAIN_4"; diff --git a/wal2json.c b/wal2json.c index 056fa02758cf..4f92d80b43db 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1118,7 +1118,15 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu } appendStringInfo(&coltypes, "%s", comma); - escape_json(&coltypes, type_str); + /* + * format_type() returns a quoted identifier, if + * required. In this case, it doesn't need to enclose the type name + * in double quotes. + */ + if (type_str[0] == '"') + appendStringInfo(&coltypes, "%s", type_str); + else + escape_json(&coltypes, type_str); pfree(type_str); @@ -1446,7 +1454,15 @@ pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple } appendStringInfo(&pktypes, "%s", comma); - escape_json(&pktypes, type_str); + /* + * format_type() returns a quoted identifier, if + * required. In this case, it doesn't need to enclose the type name + * in double quotes. + */ + if (type_str[0] == '"') + appendStringInfo(&pktypes, "%s", type_str); + else + escape_json(&pktypes, type_str); pfree(type_str); } @@ -1977,7 +1993,15 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple type_str = format_type_with_typemod(attr->atttypid, attr->atttypmod); appendStringInfoString(ctx->out, ",\"type\":"); - appendStringInfo(ctx->out, "\"%s\"", type_str); + /* + * format_type_with_typemod() returns a quoted identifier, if + * required. In this case, it doesn't need to enclose the type name + * in double quotes. + */ + if (type_str[0] == '"') + appendStringInfo(ctx->out, "%s", type_str); + else + appendStringInfo(ctx->out, "\"%s\"", type_str); pfree(type_str); ReleaseSysCache(type_tuple); From 36fbee6cbb7e4bc1bf9ee4f55842ab51393e3ac0 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 29 Aug 2021 12:36:04 -0300 Subject: [PATCH 115/154] Stamp 2.4 --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 939f167027bc..8088ee069676 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (inclu If you compile PostgreSQL by yourself and install it in `/home/euler/pg13`: ``` -$ tar -zxf wal2json-wal2json_2_3.tar.gz -$ cd wal2json-wal2json_2_3 +$ tar -zxf wal2json-wal2json_2_4.tar.gz +$ cd wal2json-wal2json_2_4 $ export PATH=/home/euler/pg13/bin:$PATH $ make $ make install @@ -51,8 +51,8 @@ If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` $ sudo yum install postgresql13-devel -$ tar -zxf wal2json-wal2json_2_3.tar.gz -$ cd wal2json-wal2json_2_3 +$ tar -zxf wal2json-wal2json_2_4.tar.gz +$ cd wal2json-wal2json_2_4 $ export PATH=/usr/pgsql-13/bin:$PATH $ make $ make install @@ -62,8 +62,8 @@ If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Ap ``` $ sudo apt-get install postgresql-server-dev-13 -$ tar -zxf wal2json-wal2json_2_3.tar.gz -$ cd wal2json-wal2json_2_3 +$ tar -zxf wal2json-wal2json_2_4.tar.gz +$ cd wal2json-wal2json_2_4 $ export PATH=/usr/lib/postgresql/13/bin:$PATH $ make $ make install From 055d80b30771ab9a760b529f217606d2e10e4a87 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 22 Dec 2021 23:12:48 -0300 Subject: [PATCH 116/154] default value was not always printed in v1 This bug prevents a default value to be printed in v1 after a TRUNCATE statement. Reported by @ls-guillaume-rebesche Fixes #225 --- expected/default.out | 37 +++++++++++++++++++++++++++++++++---- sql/default.sql | 6 ++++++ wal2json.c | 22 +++++++++++----------- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/expected/default.out b/expected/default.out index 69c85f5336c4..3619c9c532ec 100644 --- a/expected/default.out +++ b/expected/default.out @@ -2,6 +2,7 @@ -- predictability SET synchronous_commit = on; CREATE TABLE w2j_default (a serial, b integer DEFAULT 6, c text DEFAULT 'wal2json', d timestamp DEFAULT '2020-07-12 11:55:30', e integer DEFAULT NULL, f integer, PRIMARY KEY(a)); +CREATE TABLE w2j_truncate (a serial primary key, b text not null); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- @@ -11,6 +12,9 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO w2j_default (b, c ,d, e, f) VALUES(2, 'test', '2020-03-01 08:09:00', 80, 10); INSERT INTO w2j_default DEFAULT VALUES; UPDATE w2j_default SET b = 3 WHERE a = 1; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); +TRUNCATE w2j_truncate; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); -- without include-default parameter SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); data @@ -18,7 +22,10 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} -(3 rows) + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columnvalues":[1,"foo@bar.com"]}]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columnvalues":[2,"foo@bar.com"]}]} +(6 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); data @@ -32,7 +39,16 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"action":"B"} {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":3},{"name":"c","type":"text","value":"test"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020"},{"name":"e","type":"integer","value":80},{"name":"f","type":"integer","value":10}],"identity":[{"name":"a","type":"integer","value":1}]} {"action":"C"} -(9 rows) + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"foo@bar.com"}]} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"w2j_truncate"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"text","value":"foo@bar.com"}]} + {"action":"C"} +(18 rows) -- with include-default parameter SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-default', '1'); @@ -41,7 +57,10 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} -(3 rows) + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columndefaults":["nextval('w2j_truncate_a_seq'::regclass)",null],"columnvalues":[1,"foo@bar.com"]}]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columndefaults":["nextval('w2j_truncate_a_seq'::regclass)",null],"columnvalues":[2,"foo@bar.com"]}]} +(6 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-default', '1'); data @@ -55,7 +74,16 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"action":"B"} {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":3,"default":"6"},{"name":"c","type":"text","value":"test","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":80,"default":null},{"name":"f","type":"integer","value":10,"default":null}],"identity":[{"name":"a","type":"integer","value":1}]} {"action":"C"} -(9 rows) + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_truncate_a_seq'::regclass)"},{"name":"b","type":"text","value":"foo@bar.com","default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"T","schema":"public","table":"w2j_truncate"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":2,"default":"nextval('w2j_truncate_a_seq'::regclass)"},{"name":"b","type":"text","value":"foo@bar.com","default":null}]} + {"action":"C"} +(18 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? @@ -64,3 +92,4 @@ SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); (1 row) DROP TABLE w2j_default; +DROP TABLE w2j_truncate; diff --git a/sql/default.sql b/sql/default.sql index 8d3d107efb45..5b8575996bf2 100644 --- a/sql/default.sql +++ b/sql/default.sql @@ -4,6 +4,7 @@ SET synchronous_commit = on; CREATE TABLE w2j_default (a serial, b integer DEFAULT 6, c text DEFAULT 'wal2json', d timestamp DEFAULT '2020-07-12 11:55:30', e integer DEFAULT NULL, f integer, PRIMARY KEY(a)); +CREATE TABLE w2j_truncate (a serial primary key, b text not null); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); @@ -11,6 +12,10 @@ INSERT INTO w2j_default (b, c ,d, e, f) VALUES(2, 'test', '2020-03-01 08:09:00', INSERT INTO w2j_default DEFAULT VALUES; UPDATE w2j_default SET b = 3 WHERE a = 1; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); +TRUNCATE w2j_truncate; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); + -- without include-default parameter SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); @@ -22,3 +27,4 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); DROP TABLE w2j_default; +DROP TABLE w2j_truncate; diff --git a/wal2json.c b/wal2json.c index 4f92d80b43db..04fb0c54df57 100644 --- a/wal2json.c +++ b/wal2json.c @@ -135,8 +135,8 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferChange *change); #endif -static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Oid reloid); -static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Oid reloid); +static void columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Relation relation); +static void tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Relation relation); static void pk_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool addcomma); static void identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs); static bool parse_table_identifier(List *qualified_tables, char separator, List **select_tables); @@ -949,7 +949,7 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, * replident: is this tuple a replica identity? */ static void -tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Oid reloid) +tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs, bool replident, bool addcomma, Relation relation) { JsonDecodingData *data; int natt; @@ -1169,7 +1169,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu ScanKeyInit(&scankeys[0], Anum_pg_attrdef_adrelid, BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(reloid)); + ObjectIdGetDatum(relation->rd_id)); ScanKeyInit(&scankeys[1], Anum_pg_attrdef_adnum, BTEqualStrategyNumber, F_INT2EQ, @@ -1187,7 +1187,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu { result = TextDatumGetCString(DirectFunctionCall2(pg_get_expr, def_value, - ObjectIdGetDatum(tuple->t_tableOid))); + ObjectIdGetDatum(relation->rd_id))); appendStringInfo(&coldefaults, "%s\"%s\"", comma, result); pfree(result); @@ -1346,9 +1346,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* Print columns information */ static void -columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Oid reloid) +columns_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, bool addcomma, Relation relation) { - tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, addcomma, reloid); + tuple_to_stringinfo(ctx, tupdesc, tuple, NULL, false, addcomma, relation); } /* Print replica identity information */ @@ -1356,7 +1356,7 @@ static void identity_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tuple, Bitmapset *bs) { /* Last parameter does not matter */ - tuple_to_stringinfo(ctx, tupdesc, tuple, bs, true, false, InvalidOid); + tuple_to_stringinfo(ctx, tupdesc, tuple, bs, true, false, NULL); } /* Print primary key information */ @@ -1751,17 +1751,17 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) { - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, false); } else { - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, change->data.tp.relnode.relNode); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, relation); } break; case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ - columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, change->data.tp.relnode.relNode); + columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); From a6230019ff9b5dc0d2818051c42cff979f3212ee Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 26 Jan 2022 12:09:59 -0300 Subject: [PATCH 117/154] Parameter write-in-chunks is only used for format version 1 If you set format-version to 2, parameter write-in-chunks has no effect. Document this behavior. Fixes #228 --- README.md | 2 +- wal2json.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8088ee069676..2d2180dcc046 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Parameters * `include-default`: add default expression. Default is _false_. * `include-pk`: add _primary key_ information as _pk_. Column name and data type is included. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. -* `write-in-chunks`: write after every change instead of every changeset. Default is _false_. +* `write-in-chunks`: write after every change instead of every changeset. Only used when `format-version` is `1`. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. * `include-transaction`: emit records denoting the start and end of each transaction. Default is _true_. * `include-unchanged-toast` (deprecated): Don't use it. It is deprecated. diff --git a/wal2json.c b/wal2json.c index 04fb0c54df57..d4da1c2a484a 100644 --- a/wal2json.c +++ b/wal2json.c @@ -68,7 +68,7 @@ typedef struct bool include_pk; /* include primary key */ bool pretty_print; /* pretty-print JSON? */ - bool write_in_chunks; /* write in chunks? */ + bool write_in_chunks; /* write in chunks? (v1) */ JsonAction actions; /* output only these actions */ From 64f43757f2d511a7a288a654ee369b849d7671fa Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 26 Jan 2022 12:15:45 -0300 Subject: [PATCH 118/154] Add Postgres 14 to the installation instructions Refer to the latest Postgres version in the instructions. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2d2180dcc046..2360e7ea95bf 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ This extension is supported on [those platforms](http://www.postgresql.org/docs/ In Red Hat/CentOS: ``` -$ sudo yum install wal2json13 +$ sudo yum install wal2json14 ``` In Debian/Ubuntu: ``` -$ sudo apt-get install postgresql-13-wal2json +$ sudo apt-get install postgresql-14-wal2json ``` You can also keep up with the latest fixes and features cloning the Git repository. @@ -35,14 +35,14 @@ $ git clone https://github.com/eulerto/wal2json.git Unix based Operating Systems ---------------------------- -Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql13-devel` and add `/usr/pgsql-13/bin` to your search path (yum uses `13, 12, 11, 10, 96 or 95`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-13` and add `/usr/lib/postgresql/13/bin` to your search path. (apt uses `13, 12, 11, 10, 9.6 or 9.5`). +Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql14-devel` and add `/usr/pgsql-14/bin` to your search path (yum uses `14, 13, 12, 11, 10, 96 or 95`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-14` and add `/usr/lib/postgresql/14/bin` to your search path. (apt uses `14, 13, 12, 11, 10, 9.6 or 9.5`). -If you compile PostgreSQL by yourself and install it in `/home/euler/pg13`: +If you compile PostgreSQL by yourself and install it in `/home/euler/pg14`: ``` $ tar -zxf wal2json-wal2json_2_4.tar.gz $ cd wal2json-wal2json_2_4 -$ export PATH=/home/euler/pg13/bin:$PATH +$ export PATH=/home/euler/pg14/bin:$PATH $ make $ make install ``` @@ -50,10 +50,10 @@ $ make install If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` -$ sudo yum install postgresql13-devel +$ sudo yum install postgresql14-devel $ tar -zxf wal2json-wal2json_2_4.tar.gz $ cd wal2json-wal2json_2_4 -$ export PATH=/usr/pgsql-13/bin:$PATH +$ export PATH=/usr/pgsql-14/bin:$PATH $ make $ make install ``` @@ -61,10 +61,10 @@ $ make install If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt): ``` -$ sudo apt-get install postgresql-server-dev-13 +$ sudo apt-get install postgresql-server-dev-14 $ tar -zxf wal2json-wal2json_2_4.tar.gz $ cd wal2json-wal2json_2_4 -$ export PATH=/usr/lib/postgresql/13/bin:$PATH +$ export PATH=/usr/lib/postgresql/14/bin:$PATH $ make $ make install ``` From 0d4e1c6415592a99a13a75be0fa0f15c57561606 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 26 Jan 2022 12:18:59 -0300 Subject: [PATCH 119/154] Update copyright year --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 4e12addd400f..b1ade67bf54a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2020, Euler Taveira de Oliveira +Copyright (c) 2013-2022, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index 2360e7ea95bf..57d8ba59c991 100644 --- a/README.md +++ b/README.md @@ -496,7 +496,7 @@ DROP TABLE License ======= -> Copyright (c) 2013-2020, Euler Taveira de Oliveira +> Copyright (c) 2013-2022, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index d4da1c2a484a..b2a16198db13 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2020, Euler Taveira de Oliveira + * Copyright (c) 2013-2022, Euler Taveira de Oliveira * * IDENTIFICATION * contrib/wal2json/wal2json.c From 499a0baf91860ac8c7cad66f2c01dbf827148610 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Tue, 1 Mar 2022 06:12:20 -0600 Subject: [PATCH 120/154] Add include-type-oids support in format-version 2 --- Makefile | 3 +- expected/type_oid.out | 68 +++++++++++++++++++++++++++++++++++++++++++ sql/type_oid.sql | 25 ++++++++++++++++ wal2json.c | 9 ++++++ 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 expected/type_oid.out create mode 100644 sql/type_oid.sql diff --git a/Makefile b/Makefile index 43d324cfbfd6..6b7187111905 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ MODULES = wal2json REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ - include_domain_data_type truncate actions position default pk rename_column + include_domain_data_type truncate type_oid actions position default \ + pk rename_column PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/type_oid.out b/expected/type_oid.out new file mode 100644 index 000000000000..e49343f1f61f --- /dev/null +++ b/expected/type_oid.out @@ -0,0 +1,68 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +DROP TABLE IF EXISTS w2j_type_oid; +NOTICE: table "w2j_type_oid" does not exist, skipping +CREATE TABLE w2j_type_oid (a integer, b boolean, primary key(a)); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_type_oid (a, b) VALUES(1, true); +UPDATE w2j_type_oid SET a = 3; +DELETE FROM w2j_type_oid WHERE a = 3; +-- without include-type-oids parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_type_oid","columnnames":["a","b"],"columntypes":["integer","boolean"],"columnvalues":[1,true]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_type_oid","columnnames":["a","b"],"columntypes":["integer","boolean"],"columnvalues":[3,true],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[{"kind":"delete","schema":"public","table":"w2j_type_oid","oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[3]}}]} +(3 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_type_oid","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"boolean","value":true}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_type_oid","columns":[{"name":"a","type":"integer","value":3},{"name":"b","type":"boolean","value":true}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"w2j_type_oid","identity":[{"name":"a","type":"integer","value":3}]} + {"action":"C"} +(9 rows) + +-- with include-type-oids parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-type-oids', '1'); + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_type_oid","columnnames":["a","b"],"columntypes":["integer","boolean"],"columntypeoids":[23,16],"columnvalues":[1,true]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_type_oid","columnnames":["a","b"],"columntypes":["integer","boolean"],"columntypeoids":[23,16],"columnvalues":[3,true],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keytypeoids":[23],"keyvalues":[1]}}]} + {"change":[{"kind":"delete","schema":"public","table":"w2j_type_oid","oldkeys":{"keynames":["a"],"keytypes":["integer"],"keytypeoids":[23],"keyvalues":[3]}}]} +(3 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-type-oids', '1'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_type_oid","columns":[{"name":"a","type":"integer","typeoid":23,"value":1},{"name":"b","type":"boolean","typeoid":16,"value":true}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_type_oid","columns":[{"name":"a","type":"integer","typeoid":23,"value":3},{"name":"b","type":"boolean","typeoid":16,"value":true}],"identity":[{"name":"a","type":"integer","typeoid":23,"value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"w2j_type_oid","identity":[{"name":"a","type":"integer","typeoid":23,"value":3}]} + {"action":"C"} +(9 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE w2j_type_oid; diff --git a/sql/type_oid.sql b/sql/type_oid.sql new file mode 100644 index 000000000000..5249e6a5b967 --- /dev/null +++ b/sql/type_oid.sql @@ -0,0 +1,25 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; + +DROP TABLE IF EXISTS w2j_type_oid; +CREATE TABLE w2j_type_oid (a integer, b boolean, primary key(a)); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +INSERT INTO w2j_type_oid (a, b) VALUES(1, true); +UPDATE w2j_type_oid SET a = 3; +DELETE FROM w2j_type_oid WHERE a = 3; + +-- without include-type-oids parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + +-- with include-type-oids parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-type-oids', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-type-oids', '1'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE w2j_type_oid; diff --git a/wal2json.c b/wal2json.c index b2a16198db13..2ced62431c80 100644 --- a/wal2json.c +++ b/wal2json.c @@ -2007,6 +2007,15 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple ReleaseSysCache(type_tuple); } + /* + * Print type oid for columns. + */ + if (data->include_type_oids) + { + appendStringInfoString(ctx->out, ",\"typeoid\":"); + appendStringInfo(ctx->out, "%d", attr->atttypid); + } + if (kind != PGOUTPUTJSON_PK) { appendStringInfoString(ctx->out, ",\"value\":"); From 9ee320ad351bedfed10c8c4ddfa1dbb2d9948017 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 12 Mar 2022 20:22:36 -0300 Subject: [PATCH 121/154] unbreak test on old versions 'default' test uses TRUNCATE that is not supported in v10 and previous versions. Add an alternate test file to cover this case. --- expected/default_2.out | 93 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 expected/default_2.out diff --git a/expected/default_2.out b/expected/default_2.out new file mode 100644 index 000000000000..61ab5e41c4b4 --- /dev/null +++ b/expected/default_2.out @@ -0,0 +1,93 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +CREATE TABLE w2j_default (a serial, b integer DEFAULT 6, c text DEFAULT 'wal2json', d timestamp DEFAULT '2020-07-12 11:55:30', e integer DEFAULT NULL, f integer, PRIMARY KEY(a)); +CREATE TABLE w2j_truncate (a serial primary key, b text not null); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +INSERT INTO w2j_default (b, c ,d, e, f) VALUES(2, 'test', '2020-03-01 08:09:00', 80, 10); +INSERT INTO w2j_default DEFAULT VALUES; +UPDATE w2j_default SET b = 3 WHERE a = 1; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); +TRUNCATE w2j_truncate; +INSERT INTO w2j_truncate (b) VALUES('foo@bar.com'); +-- without include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1'); + data +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columnvalues":[1,"foo@bar.com"]}]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columnvalues":[2,"foo@bar.com"]}]} +(6 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":2},{"name":"c","type":"text","value":"test"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020"},{"name":"e","type":"integer","value":80},{"name":"f","type":"integer","value":10}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"integer","value":6},{"name":"c","type":"text","value":"wal2json"},{"name":"d","type":"timestamp without time zone","value":"Sun Jul 12 11:55:30 2020"},{"name":"e","type":"integer","value":null},{"name":"f","type":"integer","value":null}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"integer","value":3},{"name":"c","type":"text","value":"test"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020"},{"name":"e","type":"integer","value":80},{"name":"f","type":"integer","value":10}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"text","value":"foo@bar.com"}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":2},{"name":"b","type":"text","value":"foo@bar.com"}]} + {"action":"C"} +(17 rows) + +-- with include-default parameter +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-default', '1'); + data +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,2,"test","Sun Mar 01 08:09:00 2020",80,10]}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[2,6,"wal2json","Sun Jul 12 11:55:30 2020",null,null]}]} + {"change":[{"kind":"update","schema":"public","table":"w2j_default","columnnames":["a","b","c","d","e","f"],"columntypes":["integer","integer","text","timestamp without time zone","integer","integer"],"columndefaults":["nextval('w2j_default_a_seq'::regclass)","6","'wal2json'::text","'Sun Jul 12 11:55:30 2020'::timestamp without time zone",null,null],"columnvalues":[1,3,"test","Sun Mar 01 08:09:00 2020",80,10],"oldkeys":{"keynames":["a"],"keytypes":["integer"],"keyvalues":[1]}}]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columndefaults":["nextval('w2j_truncate_a_seq'::regclass)",null],"columnvalues":[1,"foo@bar.com"]}]} + {"change":[]} + {"change":[{"kind":"insert","schema":"public","table":"w2j_truncate","columnnames":["a","b"],"columntypes":["integer","text"],"columndefaults":["nextval('w2j_truncate_a_seq'::regclass)",null],"columnvalues":[2,"foo@bar.com"]}]} +(6 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-default', '1'); + data +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":2,"default":"6"},{"name":"c","type":"text","value":"test","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":80,"default":null},{"name":"f","type":"integer","value":10,"default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":2,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":6,"default":"6"},{"name":"c","type":"text","value":"wal2json","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Jul 12 11:55:30 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":null,"default":null},{"name":"f","type":"integer","value":null,"default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_default","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_default_a_seq'::regclass)"},{"name":"b","type":"integer","value":3,"default":"6"},{"name":"c","type":"text","value":"test","default":"'wal2json'::text"},{"name":"d","type":"timestamp without time zone","value":"Sun Mar 01 08:09:00 2020","default":"'Sun Jul 12 11:55:30 2020'::timestamp without time zone"},{"name":"e","type":"integer","value":80,"default":null},{"name":"f","type":"integer","value":10,"default":null}],"identity":[{"name":"a","type":"integer","value":1}]} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":1,"default":"nextval('w2j_truncate_a_seq'::regclass)"},{"name":"b","type":"text","value":"foo@bar.com","default":null}]} + {"action":"C"} + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_truncate","columns":[{"name":"a","type":"integer","value":2,"default":"nextval('w2j_truncate_a_seq'::regclass)"},{"name":"b","type":"text","value":"foo@bar.com","default":null}]} + {"action":"C"} +(17 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE w2j_default; +DROP TABLE w2j_truncate; From 665173c92701dc493d403a81959c7ce59538e08b Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sun, 13 Mar 2022 11:17:10 -0300 Subject: [PATCH 122/154] Array type does not print the correct type name If the base type requires quotes and the type is an array, wal2json is not quoting the whole type name. Instead, it was not considering the brackets as part of the type name. Fix both format versions. Fixes #233 --- expected/include_domain_data_type.out | 83 +++++++++++++++++++++++++-- sql/include_domain_data_type.sql | 12 ++++ wal2json.c | 16 ++++-- 3 files changed, 100 insertions(+), 11 deletions(-) diff --git a/expected/include_domain_data_type.out b/expected/include_domain_data_type.out index c4d800f561a4..7bf55750b46e 100644 --- a/expected/include_domain_data_type.out +++ b/expected/include_domain_data_type.out @@ -6,6 +6,7 @@ CREATE DOMAIN "wal2json_DOMAIN_1" AS bigint; CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); CREATE DOMAIN wal2json_domain_3 AS varchar(30); CREATE DOMAIN "wal2json_DOMAIN_4" AS bit varying(20); +CREATE TYPE "wal2json_Type" AS ENUM('a', 'b', 'c'); CREATE TABLE test_wal2json_5 ( a smallserial, b smallint, @@ -25,6 +26,11 @@ o json, p tsvector, PRIMARY KEY(b, c, d) ); +CREATE TABLE test_wal2json_6 ( +a integer, +b "wal2json_Type"[], +PRIMARY KEY(a) +); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); ?column? ---------- @@ -33,6 +39,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); UPDATE test_wal2json_5 SET f = -f WHERE b = 1; +INSERT INTO test_wal2json_6 (a, b) VALUES(1, array['b', 'c']::"wal2json_Type"[]); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-pk', '1'); data -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -73,7 +80,23 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } + ] + } -(2 rows) + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_6", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "\"wal2json_Type\"[]"], + + "columnvalues": [1, "{b,c}"], + + "pk": { + + "pknames": ["a"], + + "pktypes": ["integer"] + + } + + } + + ] + + } +(3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-pk', '1'); data @@ -115,7 +138,23 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } + ] + } -(2 rows) + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_6", + + "columnnames": ["a", "b"], + + "columntypes": ["integer", "\"wal2json_Type\"[]"], + + "columnvalues": [1, "{b,c}"], + + "pk": { + + "pknames": ["a"], + + "pktypes": ["integer"] + + } + + } + + ] + + } +(3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-typmod', '0'); data @@ -149,7 +188,19 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } + ] + } -(2 rows) + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_6", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "_wal2json_Type"], + + "columnvalues": [1, "{b,c}"] + + } + + ] + + } +(3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-typmod', '0'); data @@ -183,7 +234,19 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo } + ] + } -(2 rows) + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "test_wal2json_6", + + "columnnames": ["a", "b"], + + "columntypes": ["int4", "_wal2json_Type"], + + "columnvalues": [1, "{b,c}"] + + } + + ] + + } +(3 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '0', 'include-pk', '1'); data @@ -194,7 +257,10 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"action":"B"} {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_DOMAIN_1","value":"3"},{"name":"e","type":"wal2json_domain_2","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"wal2json_domain_3","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"wal2json_DOMAIN_4","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"wal2json_DOMAIN_1","value":"3"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"wal2json_DOMAIN_1"}]} {"action":"C"} -(6 rows) + {"action":"B"} + {"action":"I","schema":"public","table":"test_wal2json_6","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"\"wal2json_Type\"[]","value":"{b,c}"}],"pk":[{"name":"a","type":"integer"}]} + {"action":"C"} +(9 rows) SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-domain-data-type', '1', 'include-pk', '1'); data @@ -205,7 +271,10 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'for {"action":"B"} {"action":"U","schema":"public","table":"test_wal2json_5","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"},{"name":"e","type":"numeric(5,3)","value":"3.540"},{"name":"f","type":"real","value":-876.563},{"name":"g","type":"double precision","value":1.23},{"name":"h","type":"character(10)","value":"teste "},{"name":"i","type":"character varying(30)","value":"testando"},{"name":"j","type":"text","value":"um texto longo"},{"name":"k","type":"bit varying(20)","value":"001110010101010"},{"name":"l","type":"timestamp without time zone","value":"Sat Nov 02 17:30:52 2013"},{"name":"m","type":"date","value":"02-04-2013"},{"name":"n","type":"boolean","value":true},{"name":"o","type":"json","value":"{ \"a\": 123 }"},{"name":"p","type":"tsvector","value":"'Old' 'Parr'"}],"identity":[{"name":"b","type":"smallint","value":1},{"name":"c","type":"integer","value":2},{"name":"d","type":"bigint","value":"3"}],"pk":[{"name":"b","type":"smallint"},{"name":"c","type":"integer"},{"name":"d","type":"bigint"}]} {"action":"C"} -(6 rows) + {"action":"B"} + {"action":"I","schema":"public","table":"test_wal2json_6","columns":[{"name":"a","type":"integer","value":1},{"name":"b","type":"\"wal2json_Type\"[]","value":"{b,c}"}],"pk":[{"name":"a","type":"integer"}]} + {"action":"C"} +(9 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? @@ -214,7 +283,9 @@ SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); (1 row) DROP TABLE test_wal2json_5; +DROP TABLE test_wal2json_6; DROP DOMAIN "wal2json_DOMAIN_1"; DROP DOMAIN wal2json_domain_2; DROP DOMAIN wal2json_domain_3; DROP DOMAIN "wal2json_DOMAIN_4"; +DROP TYPE "wal2json_Type"; diff --git a/sql/include_domain_data_type.sql b/sql/include_domain_data_type.sql index ad1b9ec4388b..ee3e5bad5e1e 100644 --- a/sql/include_domain_data_type.sql +++ b/sql/include_domain_data_type.sql @@ -9,6 +9,8 @@ CREATE DOMAIN wal2json_domain_2 AS numeric(5,3); CREATE DOMAIN wal2json_domain_3 AS varchar(30); CREATE DOMAIN "wal2json_DOMAIN_4" AS bit varying(20); +CREATE TYPE "wal2json_Type" AS ENUM('a', 'b', 'c'); + CREATE TABLE test_wal2json_5 ( a smallserial, b smallint, @@ -29,12 +31,20 @@ p tsvector, PRIMARY KEY(b, c, d) ); +CREATE TABLE test_wal2json_6 ( +a integer, +b "wal2json_Type"[], +PRIMARY KEY(a) +); + SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); INSERT INTO test_wal2json_5 (b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) VALUES(1, 2, 3, 3.54, 876.563452345, 1.23, 'teste', 'testando', 'um texto longo', B'001110010101010', '2013-11-02 17:30:52', '2013-02-04', true, '{ "a": 123 }', 'Old Old Parr'::tsvector); UPDATE test_wal2json_5 SET f = -f WHERE b = 1; +INSERT INTO test_wal2json_6 (a, b) VALUES(1, array['b', 'c']::"wal2json_Type"[]); + SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-pk', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '1', 'include-pk', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-domain-data-type', '0', 'include-typmod', '0'); @@ -44,7 +54,9 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'for SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); DROP TABLE test_wal2json_5; +DROP TABLE test_wal2json_6; DROP DOMAIN "wal2json_DOMAIN_1"; DROP DOMAIN wal2json_domain_2; DROP DOMAIN wal2json_domain_3; DROP DOMAIN "wal2json_DOMAIN_4"; +DROP TYPE "wal2json_Type"; diff --git a/wal2json.c b/wal2json.c index 2ced62431c80..4916379ae378 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1082,6 +1082,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu if (data->include_types) { char *type_str; + int len; Form_pg_type type_form = (Form_pg_type) GETSTRUCT(type_tuple); /* @@ -1121,9 +1122,11 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* * format_type() returns a quoted identifier, if * required. In this case, it doesn't need to enclose the type name - * in double quotes. + * in double quotes. However, if it is an array type, it should + * escape it because the brackets are outside the double quotes. */ - if (type_str[0] == '"') + len = strlen(type_str); + if (type_str[0] == '"' && type_str[len - 1] != ']') appendStringInfo(&coltypes, "%s", type_str); else escape_json(&coltypes, type_str); @@ -1979,6 +1982,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple HeapTuple type_tuple; Form_pg_type type_form; char *type_str; + int len; type_tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(attr->atttypid)); type_form = (Form_pg_type) GETSTRUCT(type_tuple); @@ -1996,12 +2000,14 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple /* * format_type_with_typemod() returns a quoted identifier, if * required. In this case, it doesn't need to enclose the type name - * in double quotes. + * in double quotes. However, if it is an array type, it should + * escape it because the brackets are outside the double quotes. */ - if (type_str[0] == '"') + len = strlen(type_str); + if (type_str[0] == '"' && type_str[len -1] != ']') appendStringInfo(ctx->out, "%s", type_str); else - appendStringInfo(ctx->out, "\"%s\"", type_str); + escape_json(ctx->out, type_str); pfree(type_str); ReleaseSysCache(type_tuple); From 53b548a29ebd6119323b6eb2f6013d7c5fe807ec Mon Sep 17 00:00:00 2001 From: nchuxyz Date: Wed, 1 Sep 2021 21:10:36 +0800 Subject: [PATCH 123/154] Lag tracking support See lag times in pg_stat_replication. --- wal2json.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wal2json.c b/wal2json.c index 4916379ae378..75b33c8d0bd3 100644 --- a/wal2json.c +++ b/wal2json.c @@ -876,6 +876,10 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; +#if PG_VERSION_NUM >= 100000 + OutputPluginUpdateProgress(ctx); +#endif + elog(DEBUG2, "my change counter: " UINT64_FORMAT " ; # of changes: " UINT64_FORMAT " ; # of changes in memory: " UINT64_FORMAT, data->nr_changes, txn->nentries, txn->nentries_mem); elog(DEBUG2, "# of subxacts: %d", txn->nsubtxns); From 71f0143aa7eef984e328b8a71d3a3bbc686821f4 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 25 Jul 2022 18:34:47 -0400 Subject: [PATCH 124/154] Add PostgreSQL 15 support --- wal2json.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 75b33c8d0bd3..462882fe5d35 100644 --- a/wal2json.c +++ b/wal2json.c @@ -819,8 +819,13 @@ pg_decode_begin_txn_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) pfree(lsn_str); } +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, "%s\"timestamp\":%s\"%s\",%s", data->ht, data->sp, timestamptz_to_str(txn->xact_time.commit_time), data->nl); +#else if (data->include_timestamp) appendStringInfo(ctx->out, "%s\"timestamp\":%s\"%s\",%s", data->ht, data->sp, timestamptz_to_str(txn->commit_time), data->nl); +#endif #if PG_VERSION_NUM >= 90500 if (data->include_origin) @@ -846,8 +851,14 @@ pg_decode_begin_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) appendStringInfoString(ctx->out, "{\"action\":\"B\""); if (data->include_xids) appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->xact_time.commit_time)); +#else if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#endif #if PG_VERSION_NUM >= 90500 if (data->include_origin) @@ -876,7 +887,9 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; -#if PG_VERSION_NUM >= 100000 +#if PG_VERSION_NUM >= 150000 + OutputPluginUpdateProgress(ctx, false); +#elif PG_VERSION_NUM >= 100000 OutputPluginUpdateProgress(ctx); #endif @@ -924,8 +937,14 @@ pg_decode_commit_txn_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfoString(ctx->out, "{\"action\":\"C\""); if (data->include_xids) appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); + +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->xact_time.commit_time)); +#else if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#endif #if PG_VERSION_NUM >= 90500 if (data->include_origin) @@ -2207,8 +2226,13 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (data->include_xids) appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->xact_time.commit_time)); +#else if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#endif #if PG_VERSION_NUM >= 90500 if (data->include_origin) @@ -2519,8 +2543,13 @@ pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, if (data->include_timestamp) { +#if PG_VERSION_NUM >= 150000 + if (transactional) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->xact_time.commit_time)); +#else if (transactional) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#endif else appendStringInfoString(ctx->out, ",\"timestamp\":null"); } @@ -2637,8 +2666,13 @@ static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, if (data->include_xids) appendStringInfo(ctx->out, "%s%s%s\"xid\":%s%u,%s", data->ht, data->ht, data->ht, data->sp, txn->xid, data->nl); +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, "%s%s%s\"timestamp\":%s\"%s\",%s", data->ht, data->ht, data->ht, data->sp, timestamptz_to_str(txn->xact_time.commit_time), data->nl); +#else if (data->include_timestamp) appendStringInfo(ctx->out, "%s%s%s\"timestamp\":%s\"%s\",%s", data->ht, data->ht, data->ht, data->sp, timestamptz_to_str(txn->commit_time), data->nl); +#endif if (data->include_origin) appendStringInfo(ctx->out, "%s%s%s\"origin\":%s%u,%s", data->ht, data->ht, data->ht, data->sp, txn->origin_id, data->nl); @@ -2722,8 +2756,13 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, if (data->include_xids) appendStringInfo(ctx->out, ",\"xid\":%u", txn->xid); +#if PG_VERSION_NUM >= 150000 + if (data->include_timestamp) + appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->xact_time.commit_time)); +#else if (data->include_timestamp) appendStringInfo(ctx->out, ",\"timestamp\":\"%s\"", timestamptz_to_str(txn->commit_time)); +#endif if (data->include_origin) appendStringInfo(ctx->out, ",\"origin\":%u", txn->origin_id); From 770872b890f9e122290f178e7c7bfa19ec7afa94 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 11 Oct 2022 08:48:09 -0300 Subject: [PATCH 125/154] Stamp 2.5 --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 57d8ba59c991..7d7570492f1c 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (inclu If you compile PostgreSQL by yourself and install it in `/home/euler/pg14`: ``` -$ tar -zxf wal2json-wal2json_2_4.tar.gz -$ cd wal2json-wal2json_2_4 +$ tar -zxf wal2json-wal2json_2_5.tar.gz +$ cd wal2json-wal2json_2_5 $ export PATH=/home/euler/pg14/bin:$PATH $ make $ make install @@ -51,8 +51,8 @@ If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` $ sudo yum install postgresql14-devel -$ tar -zxf wal2json-wal2json_2_4.tar.gz -$ cd wal2json-wal2json_2_4 +$ tar -zxf wal2json-wal2json_2_5.tar.gz +$ cd wal2json-wal2json_2_5 $ export PATH=/usr/pgsql-14/bin:$PATH $ make $ make install @@ -62,8 +62,8 @@ If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Ap ``` $ sudo apt-get install postgresql-server-dev-14 -$ tar -zxf wal2json-wal2json_2_4.tar.gz -$ cd wal2json-wal2json_2_4 +$ tar -zxf wal2json-wal2json_2_5.tar.gz +$ cd wal2json-wal2json_2_5 $ export PATH=/usr/lib/postgresql/14/bin:$PATH $ make $ make install From bb7cd505629e6fbd0846ff5cda787c0c486563c5 Mon Sep 17 00:00:00 2001 From: Shubham Dhama Date: Tue, 22 Nov 2022 18:58:06 +0530 Subject: [PATCH 126/154] Add option to output numeric data types as string. (#255) Add option to output numeric data types as string. Data types like `numeric`, `real`, `double precision` supports `Infinity`, `-Infinity` and `NaN` values. Currently these values output as `null` because JSON specification does not recognize them as valid numeric values. This will create problems for the users of wal2json who need these values to maintain data integerity. --- Makefile | 2 +- README.md | 1 + expected/numeric_data_types_as_string.out | 187 ++++++++++++++++++++++ sql/numeric_data_types_as_string.sql | 33 ++++ wal2json.c | 57 ++++++- 5 files changed, 274 insertions(+), 6 deletions(-) create mode 100644 expected/numeric_data_types_as_string.out create mode 100644 sql/numeric_data_types_as_string.sql diff --git a/Makefile b/Makefile index 6b7187111905..c0effef25d5e 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ delete3 delete4 savepoint specialvalue toast bytea message typmod \ filtertable selecttable include_timestamp include_lsn include_xids \ include_domain_data_type truncate type_oid actions position default \ - pk rename_column + pk rename_column numeric_data_types_as_string PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/README.md b/README.md index 7d7570492f1c..3fd55ed3e91f 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ Parameters * `include-not-null`: add _not null_ information as _columnoptionals_. Default is _false_. * `include-default`: add default expression. Default is _false_. * `include-pk`: add _primary key_ information as _pk_. Column name and data type is included. Default is _false_. +* `numeric-data-types-as-string`: use string for numeric data types. JSON specification does not recognize `Infinity` and `NaN` as valid numeric values. There might be [potential interoperability problems](https://datatracker.ietf.org/doc/html/rfc7159#section-6) for double precision numbers. Default is _false_. * `pretty-print`: add spaces and indentation to JSON structures. Default is _false_. * `write-in-chunks`: write after every change instead of every changeset. Only used when `format-version` is `1`. Default is _false_. * `include-lsn`: add _nextlsn_ to each changeset. Default is _false_. diff --git a/expected/numeric_data_types_as_string.out b/expected/numeric_data_types_as_string.out new file mode 100644 index 000000000000..cad032e79009 --- /dev/null +++ b/expected/numeric_data_types_as_string.out @@ -0,0 +1,187 @@ +\set VERBOSITY terse +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; +CREATE TABLE table_integer (a smallserial, b smallint, c int, d bigint); +CREATE TABLE table_decimal (a real, b double precision, c numeric); +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + ?column? +---------- + init +(1 row) + +BEGIN; +INSERT INTO table_integer (b, c, d) VALUES(32767, 2147483647, 9223372036854775807); +INSERT INTO table_integer (b, c, d) VALUES(-32768, -2147483648, -9223372036854775808); +INSERT INTO table_decimal (a, b) VALUES('Infinity', 'Infinity'); +INSERT INTO table_decimal (a, b) VALUES('-Infinity', '-Infinity'); +INSERT INTO table_decimal (a, b, c) VALUES('NaN', 'NaN', 'NaN'); +INSERT INTO table_decimal (a, b, c) VALUES(123.456, 123456789.012345, 1234567890987654321.1234567890987654321); +INSERT INTO table_decimal (a, b, c) VALUES(-123.456, -123456789.012345, -1234567890987654321.1234567890987654321); +COMMIT; +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'numeric-data-types-as-string', '1'); + data +----------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "table_integer", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["smallint", "smallint", "integer", "bigint"], + + "columnvalues": ["1", "32767", "2147483647", "9223372036854775807"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_integer", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["smallint", "smallint", "integer", "bigint"], + + "columnvalues": ["2", "-32768", "-2147483648", "-9223372036854775808"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": ["Infinity", "Infinity", null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": ["-Infinity", "-Infinity", null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": ["NaN", "NaN", "NaN"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": ["123.456", "123456789.012345", "1234567890987654321.1234567890987654321"] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": ["-123.456", "-123456789.012345", "-1234567890987654321.1234567890987654321"]+ + } + + ] + + } +(1 row) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); + data +----------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "table_integer", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["smallint", "smallint", "integer", "bigint"], + + "columnvalues": [1, 32767, 2147483647, 9223372036854775807] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_integer", + + "columnnames": ["a", "b", "c", "d"], + + "columntypes": ["smallint", "smallint", "integer", "bigint"], + + "columnvalues": [2, -32768, -2147483648, -9223372036854775808] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": [null, null, null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": [null, null, null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": [null, null, null] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": [123.456, 123456789.012345, 1234567890987654321.1234567890987654321] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "table_decimal", + + "columnnames": ["a", "b", "c"], + + "columntypes": ["real", "double precision", "numeric"], + + "columnvalues": [-123.456, -123456789.012345, -1234567890987654321.1234567890987654321]+ + } + + ] + + } +(1 row) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'numeric-data-types-as-string', '1'); + data +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"table_integer","columns":[{"name":"a","type":"smallint","value":"1"},{"name":"b","type":"smallint","value":"32767"},{"name":"c","type":"integer","value":"2147483647"},{"name":"d","type":"bigint","value":"9223372036854775807"}]} + {"action":"I","schema":"public","table":"table_integer","columns":[{"name":"a","type":"smallint","value":"2"},{"name":"b","type":"smallint","value":"-32768"},{"name":"c","type":"integer","value":"-2147483648"},{"name":"d","type":"bigint","value":"-9223372036854775808"}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":"Infinity"},{"name":"b","type":"double precision","value":"Infinity"},{"name":"c","type":"numeric","value":null}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":"-Infinity"},{"name":"b","type":"double precision","value":"-Infinity"},{"name":"c","type":"numeric","value":null}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":"NaN"},{"name":"b","type":"double precision","value":"NaN"},{"name":"c","type":"numeric","value":"NaN"}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":"123.456"},{"name":"b","type":"double precision","value":"123456789.012345"},{"name":"c","type":"numeric","value":"1234567890987654321.1234567890987654321"}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":"-123.456"},{"name":"b","type":"double precision","value":"-123456789.012345"},{"name":"c","type":"numeric","value":"-1234567890987654321.1234567890987654321"}]} + {"action":"C"} +(9 rows) + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + {"action":"B"} + {"action":"I","schema":"public","table":"table_integer","columns":[{"name":"a","type":"smallint","value":1},{"name":"b","type":"smallint","value":32767},{"name":"c","type":"integer","value":2147483647},{"name":"d","type":"bigint","value":9223372036854775807}]} + {"action":"I","schema":"public","table":"table_integer","columns":[{"name":"a","type":"smallint","value":2},{"name":"b","type":"smallint","value":-32768},{"name":"c","type":"integer","value":-2147483648},{"name":"d","type":"bigint","value":-9223372036854775808}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":null},{"name":"b","type":"double precision","value":null},{"name":"c","type":"numeric","value":null}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":null},{"name":"b","type":"double precision","value":null},{"name":"c","type":"numeric","value":null}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":null},{"name":"b","type":"double precision","value":null},{"name":"c","type":"numeric","value":null}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":123.456},{"name":"b","type":"double precision","value":123456789.012345},{"name":"c","type":"numeric","value":1234567890987654321.1234567890987654321}]} + {"action":"I","schema":"public","table":"table_decimal","columns":[{"name":"a","type":"real","value":-123.456},{"name":"b","type":"double precision","value":-123456789.012345},{"name":"c","type":"numeric","value":-1234567890987654321.1234567890987654321}]} + {"action":"C"} +(9 rows) + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + ?column? +---------- + stop +(1 row) + +DROP TABLE table_integer; +DROP TABLE table_decimal; diff --git a/sql/numeric_data_types_as_string.sql b/sql/numeric_data_types_as_string.sql new file mode 100644 index 000000000000..9a06cadfaa6d --- /dev/null +++ b/sql/numeric_data_types_as_string.sql @@ -0,0 +1,33 @@ +\set VERBOSITY terse + +-- predictability +SET synchronous_commit = on; +SET extra_float_digits = 0; + + + +CREATE TABLE table_integer (a smallserial, b smallint, c int, d bigint); +CREATE TABLE table_decimal (a real, b double precision, c numeric); + +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); + +BEGIN; +INSERT INTO table_integer (b, c, d) VALUES(32767, 2147483647, 9223372036854775807); +INSERT INTO table_integer (b, c, d) VALUES(-32768, -2147483648, -9223372036854775808); + +INSERT INTO table_decimal (a, b) VALUES('Infinity', 'Infinity'); +INSERT INTO table_decimal (a, b) VALUES('-Infinity', '-Infinity'); +INSERT INTO table_decimal (a, b, c) VALUES('NaN', 'NaN', 'NaN'); +INSERT INTO table_decimal (a, b, c) VALUES(123.456, 123456789.012345, 1234567890987654321.1234567890987654321); +INSERT INTO table_decimal (a, b, c) VALUES(-123.456, -123456789.012345, -1234567890987654321.1234567890987654321); +COMMIT; + +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'numeric-data-types-as-string', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'numeric-data-types-as-string', '1'); +SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2'); + +SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); + +DROP TABLE table_integer; +DROP TABLE table_decimal; diff --git a/wal2json.c b/wal2json.c index 462882fe5d35..98cfd1d1c802 100644 --- a/wal2json.c +++ b/wal2json.c @@ -69,6 +69,7 @@ typedef struct bool pretty_print; /* pretty-print JSON? */ bool write_in_chunks; /* write in chunks? (v1) */ + bool numeric_data_types_as_string; /* use strings for numeric data types */ JsonAction actions; /* output only these actions */ @@ -261,6 +262,7 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is data->include_typmod = true; data->include_domain_data_type = false; data->include_column_positions = false; + data->numeric_data_types_as_string = false; data->pretty_print = false; data->write_in_chunks = false; data->include_lsn = false; @@ -480,6 +482,19 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool is errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname))); } + else if (strcmp(elem->defname, "numeric-data-types-as-string") == 0) + { + if (elem->arg == NULL) + { + elog(DEBUG1, "numeric-data-types-as-string argument is null"); + data->numeric_data_types_as_string = true; + } + else if (!parse_bool(strVal(elem->arg), &data->numeric_data_types_as_string)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); + } else if (strcmp(elem->defname, "pretty-print") == 0) { if (elem->arg == NULL) @@ -1259,6 +1274,10 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu * * The NaN and Infinity are not valid JSON symbols. Hence, * regardless of sign they are represented as the string null. + * + * Exception to this is when data->numeric_data_types_as_string is + * true. In this case, numbers (including NaN and Infinity values) + * are printed with quotes. */ switch (typid) { @@ -1269,7 +1288,18 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu case FLOAT4OID: case FLOAT8OID: case NUMERICOID: - if (pg_strncasecmp(outputstr, "NaN", 3) == 0 || + if (data->numeric_data_types_as_string) { + if (strspn(outputstr, "0123456789+-eE.") == strlen(outputstr) || + pg_strncasecmp(outputstr, "NaN", 3) == 0 || + pg_strncasecmp(outputstr, "Infinity", 8) == 0 || + pg_strncasecmp(outputstr, "-Infinity", 9) == 0) { + appendStringInfo(&colvalues, "%s", comma); + escape_json(&colvalues, outputstr); + } else { + elog(ERROR, "%s is not a number", outputstr); + } + } + else if (pg_strncasecmp(outputstr, "NaN", 3) == 0 || pg_strncasecmp(outputstr, "Infinity", 8) == 0 || pg_strncasecmp(outputstr, "-Infinity", 9) == 0) { @@ -1846,9 +1876,12 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, static void pg_decode_write_value(LogicalDecodingContext *ctx, Datum value, bool isnull, Oid typid) { - Oid typoutfunc; - bool isvarlena; - char *outstr; + JsonDecodingData *data; + Oid typoutfunc; + bool isvarlena; + char *outstr; + + data = ctx->output_plugin_private; if (isnull) { @@ -1885,6 +1918,10 @@ pg_decode_write_value(LogicalDecodingContext *ctx, Datum value, bool isnull, Oid * * The NaN an Infinity are not valid JSON symbols. Hence, regardless of * sign they are represented as the string null. + * + * Exception to this is when data->numeric_data_types_as_string is + * true. In this case, numbers (including NaN and Infinity values) + * are printed with quotes. */ switch (typid) { @@ -1895,7 +1932,17 @@ pg_decode_write_value(LogicalDecodingContext *ctx, Datum value, bool isnull, Oid case FLOAT4OID: case FLOAT8OID: case NUMERICOID: - if (pg_strncasecmp(outstr, "NaN", 3) == 0 || + if (data->numeric_data_types_as_string) { + if (strspn(outstr, "0123456789+-eE.") == strlen(outstr) || + pg_strncasecmp(outstr, "NaN", 3) == 0 || + pg_strncasecmp(outstr, "Infinity", 8) == 0 || + pg_strncasecmp(outstr, "-Infinity", 9) == 0) { + escape_json(ctx->out, outstr); + } else { + elog(ERROR, "%s is not a number", outstr); + } + } + else if (pg_strncasecmp(outstr, "NaN", 3) == 0 || pg_strncasecmp(outstr, "Infinity", 8) == 0 || pg_strncasecmp(outstr, "-Infinity", 9) == 0) { From beb9293e9b9e867c7cc32d649e33f15528557d4d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Thu, 16 Feb 2023 14:07:18 -0300 Subject: [PATCH 127/154] invalid JSON for non-transaction message in v1 (#266) Non-transactional messages contain only one object. It means comma should not be provided for such JSON objects. If you are sending a non-transactional message into a transaction, it should guarantee that comma is only emitted for transactional commands. Hence, the previous check is weak and it should also check for transactional information. Fixes #266 --- wal2json.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 98cfd1d1c802..323721a87722 100644 --- a/wal2json.c +++ b/wal2json.c @@ -2526,7 +2526,12 @@ pg_decode_message_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfo(ctx->out, "%s%s", data->ht, data->ht); - if (data->nr_changes > 1) + /* + * Non-transactional message contains only one object. Comma is not + * required. Avoid printing a comma for non-transactional messages that was + * provided in a transaction. + */ + if (transactional && data->nr_changes > 1) appendStringInfoChar(ctx->out, ','); appendStringInfo(ctx->out, "{%s%s%s%s\"kind\":%s\"message\",%s", data->nl, data->ht, data->ht, data->ht, data->sp, data->nl); From 703a76924efeb296e7ec231dbc3f569bc04f950f Mon Sep 17 00:00:00 2001 From: Robert Pang <59705596+robert-pang@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:29:31 -0700 Subject: [PATCH 128/154] Correct DELETED tuple reference pg_decode_change_v1 (#252) --- wal2json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wal2json.c b/wal2json.c index 323721a87722..6e1cbcd3e940 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1847,7 +1847,7 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, case REORDER_BUFFER_CHANGE_DELETE: if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) - pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); + pk_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, pkbs, true); ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, ribs); From 30d2ec11dfaa54980db4e2e1e3de8fe7ed71b6cb Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 5 Jun 2023 20:38:20 -0400 Subject: [PATCH 129/154] Avoid variable shadowing --- wal2json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wal2json.c b/wal2json.c index 6e1cbcd3e940..599bd080061d 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1204,7 +1204,7 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu SysScanDesc scan; HeapTuple def_tuple; Datum def_value; - bool isnull; + bool attisnull; char *result; ScanKeyInit(&scankeys[0], @@ -1222,9 +1222,9 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu def_tuple = systable_getnext(scan); if (HeapTupleIsValid(def_tuple)) { - def_value = fastgetattr(def_tuple, Anum_pg_attrdef_adbin, defrel->rd_att, &isnull); + def_value = fastgetattr(def_tuple, Anum_pg_attrdef_adbin, defrel->rd_att, &attisnull); - if (!isnull) + if (!attisnull) { result = TextDatumGetCString(DirectFunctionCall2(pg_get_expr, def_value, From 4f03672fbe201eff0556dd64041a801ce9129fd6 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 15 Apr 2024 19:33:37 -0300 Subject: [PATCH 130/154] Fix typo --- expected/include_timestamp.out | 2 +- sql/include_timestamp.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/expected/include_timestamp.out b/expected/include_timestamp.out index 46f464d64373..dafbe62c4f0c 100644 --- a/expected/include_timestamp.out +++ b/expected/include_timestamp.out @@ -10,7 +10,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2js init (1 row) --- One row should have one record and one timestmap +-- One row should have one record and one timestamp INSERT INTO tbl VALUES (1); SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); ?column? | ?column? diff --git a/sql/include_timestamp.sql b/sql/include_timestamp.sql index 14aa80db4a80..efa1e90bffe4 100644 --- a/sql/include_timestamp.sql +++ b/sql/include_timestamp.sql @@ -8,7 +8,7 @@ CREATE TABLE tbl (id int); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'wal2json'); --- One row should have one record and one timestmap +-- One row should have one record and one timestamp INSERT INTO tbl VALUES (1); SELECT count(*) = 1, count(distinct ((data::json)->'timestamp')::text) = 1 FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'format-version', '1', 'include-timestamp', '1'); From c744ec9b42ce337d7ce63595533f9401debcb95a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 16 Apr 2024 12:36:32 -0300 Subject: [PATCH 131/154] Fix lag tracking support for large transactions Postgres fixed some time ago a logical replication timeout during large transactions (commit postgres/postgres@f95d53eded55ecbf037f6416ced6af29a2c3caca). For Postgres 16, a proper fix was added in the logical decoding but the previous versions (10 to 14) a new function (update-replication_progress) was added. It is the same function used by pgoutput plugin. Fixes #270 --- wal2json.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 145 insertions(+), 3 deletions(-) diff --git a/wal2json.c b/wal2json.c index 599bd080061d..156e46b5a182 100644 --- a/wal2json.c +++ b/wal2json.c @@ -205,6 +205,12 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, #endif #endif +#if PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 +static void update_replication_progress(LogicalDecodingContext *ctx, bool skipped_xact); +#elif PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 150000 +static void update_replication_progress(LogicalDecodingContext *ctx); +#endif + void _PG_init(void) { @@ -902,9 +908,39 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; -#if PG_VERSION_NUM >= 150000 - OutputPluginUpdateProgress(ctx, false); -#elif PG_VERSION_NUM >= 100000 + /* + * Some older minor versions from back branches (10 to 14) calls + * OutputPluginUpdateProgress(). That's before the fix + * f95d53eded55ecbf037f6416ced6af29a2c3caca. After that, + * update_replication_progress() function is used for back branches. In + * version 15, update_replication_progress() changes the signature to + * support skipped transactions. In version 16, + * OutputPluginUpdateProgress() is back because a proper fix was added into + * logical decoding. + */ +#if PG_VERSION_NUM >= 160000 + OutputPluginUpdateProgress(ctx, false); /* XXX change 2nd param when skipped empty transaction is supported */ +#elif PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 + update_replication_progress(ctx, false); /* XXX change 2nd param when skipped empty transaction is supported */ +#elif PG_VERSION_NUM >= 140004 && PG_VERSION_NUM < 150000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 130008 && PG_VERSION_NUM < 140000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 120012 && PG_VERSION_NUM < 130000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 110017 && PG_VERSION_NUM < 120000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 100022 && PG_VERSION_NUM < 110000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 140000 && PG_VERSION_NUM < 140004 + OutputPluginUpdateProgress(ctx); +#elif PG_VERSION_NUM >= 130000 && PG_VERSION_NUM < 130008 + OutputPluginUpdateProgress(ctx); +#elif PG_VERSION_NUM >= 120000 && PG_VERSION_NUM < 120012 + OutputPluginUpdateProgress(ctx); +#elif PG_VERSION_NUM >= 110000 && PG_VERSION_NUM < 110017 + OutputPluginUpdateProgress(ctx); +#elif PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 100022 OutputPluginUpdateProgress(ctx); #endif @@ -1628,6 +1664,20 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; +#if PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 + update_replication_progress(ctx, false); +#elif PG_VERSION_NUM >= 140004 && PG_VERSION_NUM < 150000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 130008 && PG_VERSION_NUM < 140000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 120012 && PG_VERSION_NUM < 130000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 110017 && PG_VERSION_NUM < 120000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 100022 && PG_VERSION_NUM < 110000 + update_replication_progress(ctx); +#endif + if (data->format_version == 2) pg_decode_change_v2(ctx, txn, relation, change); else if (data->format_version == 1) @@ -2442,6 +2492,20 @@ pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { JsonDecodingData *data = ctx->output_plugin_private; +#if PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 + update_replication_progress(ctx, false); +#elif PG_VERSION_NUM >= 140004 && PG_VERSION_NUM < 150000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 130008 && PG_VERSION_NUM < 140000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 120012 && PG_VERSION_NUM < 130000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 110017 && PG_VERSION_NUM < 120000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 100022 && PG_VERSION_NUM < 110000 + update_replication_progress(ctx); +#endif + /* Filter message prefixes, if available */ if (list_length(data->filter_msg_prefixes) > 0) { @@ -2651,6 +2715,22 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx, { JsonDecodingData *data = ctx->output_plugin_private; + /* + * For back branches (10 to 15), update_replication_progress() should be called here. + * FIXME call OutputPluginUpdateProgress() for old minor versions? + */ +#if PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 + update_replication_progress(ctx, false); +#elif PG_VERSION_NUM >= 140004 && PG_VERSION_NUM < 150000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 130008 && PG_VERSION_NUM < 140000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 120012 && PG_VERSION_NUM < 130000 + update_replication_progress(ctx); +#elif PG_VERSION_NUM >= 110017 && PG_VERSION_NUM < 120000 + update_replication_progress(ctx); +#endif + if (data->format_version == 2) pg_decode_truncate_v2(ctx, txn, n, relations, change); else if (data->format_version == 1) @@ -3114,3 +3194,65 @@ split_string_to_oid_list(char *rawstring, char separator, List **sl) return true; } + +/* + * Try to update progress and send a keepalive message if too many changes were + * processed. + * + * For a large transaction, if we don't send any change to the downstream for a + * long time (exceeds the wal_receiver_timeout of standby) then it can timeout. + * This can happen when all or most of the changes are not published. + * + * Copied from Postgres commit f95d53eded55ecbf037f6416ced6af29a2c3caca + */ +#if PG_VERSION_NUM >= 150000 && PG_VERSION_NUM < 160000 +static void +update_replication_progress(LogicalDecodingContext *ctx, bool skipped_xact) +{ + static int changes_count = 0; + + /* + * We don't want to try sending a keepalive message after processing each + * change as that can have overhead. Tests revealed that there is no + * noticeable overhead in doing it after continuously processing 100 or so + * changes. + */ +#define CHANGES_THRESHOLD 100 + + /* + * If we are at the end of transaction LSN, update progress tracking. + * Otherwise, after continuously processing CHANGES_THRESHOLD changes, we + * try to send a keepalive message if required. + */ + if (ctx->end_xact || ++changes_count >= CHANGES_THRESHOLD) + { + OutputPluginUpdateProgress(ctx, skipped_xact); + changes_count = 0; + } +} +#elif PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 150000 +static void +update_replication_progress(LogicalDecodingContext *ctx) +{ + static int changes_count = 0; + + /* + * We don't want to try sending a keepalive message after processing each + * change as that can have overhead. Tests revealed that there is no + * noticeable overhead in doing it after continuously processing 100 or so + * changes. + */ +#define CHANGES_THRESHOLD 100 + + /* + * If we are at the end of transaction LSN, update progress tracking. + * Otherwise, after continuously processing CHANGES_THRESHOLD changes, we + * try to send a keepalive message if required. + */ + if (ctx->end_xact || ++changes_count >= CHANGES_THRESHOLD) + { + OutputPluginUpdateProgress(ctx); + changes_count = 0; + } +} +#endif From 9510a10022bf103f9720f20528335e7bb51ab0fc Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 16 Apr 2024 13:24:33 -0300 Subject: [PATCH 132/154] Add version Packages might rely on the version from source code instead of extracting the version from the tarball file name. If the WAL2JSON_VERSION contains "dev" suffix it means it is not a released version. WAL2JSON_VERSION_NUM changes only for release. After a release, the next commit will add the "dev" suffix that will be removed only for the next release. --- wal2json.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wal2json.c b/wal2json.c index 156e46b5a182..4089ab7ac017 100644 --- a/wal2json.c +++ b/wal2json.c @@ -34,6 +34,9 @@ #include "utils/rel.h" #include "utils/syscache.h" +#define WAL2JSON_VERSION "2.5dev" +#define WAL2JSON_VERSION_NUM 205 + #define WAL2JSON_FORMAT_VERSION 2 #define WAL2JSON_FORMAT_MIN_VERSION 1 From 21d39c1f8249d1d7b3f017c9d12dc1e62ee60725 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 16 Apr 2024 13:30:59 -0300 Subject: [PATCH 133/154] Replace tab with space --- wal2json.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/wal2json.c b/wal2json.c index 4089ab7ac017..0bcaec96fda2 100644 --- a/wal2json.c +++ b/wal2json.c @@ -20,7 +20,7 @@ #include "catalog/pg_type.h" #include "replication/logical.h" -#if PG_VERSION_NUM >= 90500 +#if PG_VERSION_NUM >= 90500 #include "replication/origin.h" #endif @@ -124,16 +124,16 @@ static void pg_decode_commit_txn(LogicalDecodingContext *ctx, static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); -#if PG_VERSION_NUM >= 90500 +#if PG_VERSION_NUM >= 90500 static bool pg_filter_by_origin(LogicalDecodingContext *ctx, RepOriginId origin_id); #endif -#if PG_VERSION_NUM >= 90600 +#if PG_VERSION_NUM >= 90600 static void pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr lsn, bool transactional, const char *prefix, Size content_size, const char *content); #endif -#if PG_VERSION_NUM >= 110000 +#if PG_VERSION_NUM >= 110000 static void pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int n, Relation relations[], ReorderBufferChange *change); @@ -160,13 +160,13 @@ static void pg_decode_commit_txn_v1(LogicalDecodingContext *ctx, static void pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); -#if PG_VERSION_NUM >= 90600 +#if PG_VERSION_NUM >= 90600 static void pg_decode_message_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr lsn, bool transactional, const char *prefix, Size content_size, const char *content); #endif -#if PG_VERSION_NUM >= 110000 +#if PG_VERSION_NUM >= 110000 static void pg_decode_truncate_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int n, Relation relations[], ReorderBufferChange *change); @@ -183,13 +183,13 @@ static void pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN static void pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); -#if PG_VERSION_NUM >= 90600 +#if PG_VERSION_NUM >= 90600 static void pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr lsn, bool transactional, const char *prefix, Size content_size, const char *content); #endif -#if PG_VERSION_NUM >= 110000 +#if PG_VERSION_NUM >= 110000 static void pg_decode_truncate_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int n, Relation relations[], ReorderBufferChange *change); @@ -230,13 +230,13 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb) cb->change_cb = pg_decode_change; cb->commit_cb = pg_decode_commit_txn; cb->shutdown_cb = pg_decode_shutdown; -#if PG_VERSION_NUM >= 90500 +#if PG_VERSION_NUM >= 90500 cb->filter_by_origin_cb = pg_filter_by_origin; #endif -#if PG_VERSION_NUM >= 90600 +#if PG_VERSION_NUM >= 90600 cb->message_cb = pg_decode_message; #endif -#if PG_VERSION_NUM >= 110000 +#if PG_VERSION_NUM >= 110000 cb->truncate_cb = pg_decode_truncate; #endif } @@ -1847,7 +1847,7 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfo(ctx->out, ",%s", data->nl); if (data->include_pk) -#if PG_VERSION_NUM >= 100000 +#if PG_VERSION_NUM >= 100000 pkbs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_PRIMARY_KEY); #else pkbs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_KEY); @@ -2053,7 +2053,7 @@ pg_decode_write_tuple(LogicalDecodingContext *ctx, Relation relation, HeapTuple } else if (kind == PGOUTPUTJSON_PK) { -#if PG_VERSION_NUM >= 100000 +#if PG_VERSION_NUM >= 100000 bs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_PRIMARY_KEY); #else bs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_KEY); @@ -2396,7 +2396,7 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat * Before v10, there is not rd_pkindex then rely on REPLICA * IDENTITY DEFAULT to obtain primary key. */ -#if PG_VERSION_NUM >= 100000 +#if PG_VERSION_NUM >= 100000 if (OidIsValid(relation->rd_pkindex) || OidIsValid(relation->rd_replidindex)) #else if (OidIsValid(relation->rd_replidindex)) @@ -2424,7 +2424,7 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (data->include_pk) { appendStringInfoString(ctx->out, ",\"pk\":["); -#if PG_VERSION_NUM >= 100000 +#if PG_VERSION_NUM >= 100000 if (OidIsValid(relation->rd_pkindex)) #else if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) @@ -2486,7 +2486,7 @@ pg_decode_change_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, MemoryContextReset(data->context); } -#if PG_VERSION_NUM >= 90600 +#if PG_VERSION_NUM >= 90600 /* Callback for generic logical decoding messages */ static void pg_decode_message(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -2710,7 +2710,7 @@ pg_decode_message_v2(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } #endif -#if PG_VERSION_NUM >= 110000 +#if PG_VERSION_NUM >= 110000 /* Callback for TRUNCATE command */ static void pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int n, Relation relations[], From ffad26cb876a3c022ae8b7a274494b7cde86e990 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Tue, 16 Apr 2024 21:25:08 -0300 Subject: [PATCH 134/154] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 074fa38fe5ec..25344d12c0d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /regression.diffs /regression.out /results/ +/wal2json.bc /wal2json.so *.o From 7b9017c25a14d2c386dccc005f94575122d931ac Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 20 Apr 2024 18:08:57 -0300 Subject: [PATCH 135/154] Fix include-pk when replica identity is full In format 1, the primary key information was not included even though the include-pk option is enabled. It happens when the table has a primary key and the replica identity is full. Format 2 was not affected. Fixes #273 --- expected/rename_column.out | 498 +++++++++++++++++++++---------------- sql/rename_column.sql | 6 + wal2json.c | 16 ++ 3 files changed, 308 insertions(+), 212 deletions(-) diff --git a/expected/rename_column.out b/expected/rename_column.out index 9e8d5b004236..e2544d6ccaff 100644 --- a/expected/rename_column.out +++ b/expected/rename_column.out @@ -47,232 +47,295 @@ ALTER TABLE w2j_rename_ri RENAME COLUMN a TO g; INSERT INTO w2j_rename_ri (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'Myrmecophaga tridactyla', false, 1.8); UPDATE w2j_rename_ri SET e = 3.1415 WHERE g = 456; COMMIT; +ALTER TABLE w2j_rename_pk REPLICA IDENTITY FULL; +INSERT INTO w2j_rename_pk (g, b, c, f, e) VALUES(890, '2023-10-31 03:06:00', 'Crypturellus parvirostris', true, 8.90); +UPDATE w2j_rename_pk SET e = 8.91 WHERE g = 890; +DELETE FROM w2j_rename_pk WHERE g = 890; SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); - data ---------------------------------------------------------------------------------------------------------------------- - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["a", "b", "c", "d", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560], + - "pk": { + - "pknames": ["a", "d"], + - "pktypes": ["int4", "bool"] + - } + - } + - ] + + data +-------------------------------------------------------------------------------------------------------------------------- + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560], + + "pk": { + + "pknames": ["a", "d"], + + "pktypes": ["int4", "bool"] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["a", "b", "c", "d", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + - "pk": { + - "pknames": ["a", "d"], + - "pktypes": ["int4", "bool"] + - }, + - "oldkeys": { + - "keynames": ["a", "d"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [123, true] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + + "pk": { + + "pknames": ["a", "d"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["a", "d"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [123, true] + + } + + } + + ] + } - { + - "change": [ + - ] + + { + + "change": [ + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440], + - "pk": { + - "pknames": ["a", "f"], + - "pktypes": ["int4", "bool"] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + - "pk": { + - "pknames": ["a", "f"], + - "pktypes": ["int4", "bool"] + - }, + - "oldkeys": { + - "keynames": ["a", "f"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [456, false] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["a", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300], + - "pk": { + - "pknames": ["a", "f"], + - "pktypes": ["int4", "bool"] + - } + - } + - ,{ + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["g", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800],+ - "pk": { + - "pknames": ["g", "f"], + - "pktypes": ["int4", "bool"] + - } + - } + - ,{ + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_pk", + - "columnnames": ["g", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + - "pk": { + - "pknames": ["g", "f"], + - "pktypes": ["int4", "bool"] + - }, + - "oldkeys": { + - "keynames": ["g", "f"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [456, false] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300], + + "pk": { + + "pknames": ["a", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800], + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ,{ + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["g", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["a", "b", "c", "d", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560] + - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 4.560] + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["a", "b", "c", "d", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + - "oldkeys": { + - "keynames": ["a", "d"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [123, true] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "d", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [123, "Sun Apr 26 16:23:59 2020", "Melanosuchus Niger", true, 8.760], + + "oldkeys": { + + "keynames": ["a", "d"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [123, true] + + } + + } + + ] + } - { + - "change": [ + - ] + + { + + "change": [ + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440] + - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 4.440] + + } + + ] + } - { + - "change": [ + - { + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + - "oldkeys": { + - "keynames": ["a", "f"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [456, false] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 2.718], + + "oldkeys": { + + "keynames": ["a", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + } - { + - "change": [ + - { + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["a", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300] + - } + - ,{ + - "kind": "insert", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["g", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800] + - } + - ,{ + - "kind": "update", + - "schema": "public", + - "table": "w2j_rename_ri", + - "columnnames": ["g", "b", "c", "f", "e"], + - "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + - "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + - "oldkeys": { + - "keynames": ["g", "f"], + - "keytypes": ["int4", "bool"], + - "keyvalues": [456, false] + - } + - } + - ] + + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["a", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [789, "Sun Apr 04 10:33:04 2021", "Chrysocyon brachyurus", true, 20.300] + + } + + ,{ + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [790, "Sat Apr 04 10:34:55 2020", "Myrmecophaga tridactyla", false, 1.800] + + } + + ,{ + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_ri", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [456, "Mon Dec 07 15:56:59 2020", "Panthera Onca", false, 3.142], + + "oldkeys": { + + "keynames": ["g", "f"], + + "keytypes": ["int4", "bool"], + + "keyvalues": [456, false] + + } + + } + + ] + } -(12 rows) + { + + "change": [ + + ] + + } + { + + "change": [ + + { + + "kind": "insert", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [890, "Tue Oct 31 03:06:00 2023", "Crypturellus parvirostris", true, 8.900], + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "update", + + "schema": "public", + + "table": "w2j_rename_pk", + + "columnnames": ["g", "b", "c", "f", "e"], + + "columntypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "columnvalues": [890, "Tue Oct 31 03:06:00 2023", "Crypturellus parvirostris", true, 8.910], + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["g", "b", "c", "f", "e"], + + "keytypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "keyvalues": [890, "Tue Oct 31 03:06:00 2023", "Crypturellus parvirostris", true, 8.900]+ + } + + } + + ] + + } + { + + "change": [ + + { + + "kind": "delete", + + "schema": "public", + + "table": "w2j_rename_pk", + + "pk": { + + "pknames": ["g", "f"], + + "pktypes": ["int4", "bool"] + + }, + + "oldkeys": { + + "keynames": ["g", "b", "c", "f", "e"], + + "keytypes": ["int4", "timestamp", "text", "bool", "numeric"], + + "keyvalues": [890, "Tue Oct 31 03:06:00 2023", "Crypturellus parvirostris", true, 8.910]+ + } + + } + + ] + + } +(16 rows) SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); - data ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + data +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ {"action":"B"} {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"a","type":"integer","value":123},{"name":"b","type":"timestamp without time zone","value":"Sun Apr 26 16:23:59 2020"},{"name":"c","type":"text","value":"Melanosuchus Niger"},{"name":"d","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":4.560}],"pk":[{"name":"a","type":"integer"},{"name":"d","type":"boolean"}]} {"action":"C"} @@ -311,7 +374,18 @@ SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'fo {"action":"I","schema":"public","table":"w2j_rename_ri","columns":[{"name":"g","type":"integer","value":790},{"name":"b","type":"timestamp without time zone","value":"Sat Apr 04 10:34:55 2020"},{"name":"c","type":"text","value":"Myrmecophaga tridactyla"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":1.800}],"pk":[]} {"action":"U","schema":"public","table":"w2j_rename_ri","columns":[{"name":"g","type":"integer","value":456},{"name":"b","type":"timestamp without time zone","value":"Mon Dec 07 15:56:59 2020"},{"name":"c","type":"text","value":"Panthera Onca"},{"name":"f","type":"boolean","value":false},{"name":"e","type":"numeric(5,3)","value":3.142}],"identity":[{"name":"g","type":"integer","value":456},{"name":"f","type":"boolean","value":false}],"pk":[]} {"action":"C"} -(38 rows) + {"action":"B"} + {"action":"C"} + {"action":"B"} + {"action":"I","schema":"public","table":"w2j_rename_pk","columns":[{"name":"g","type":"integer","value":890},{"name":"b","type":"timestamp without time zone","value":"Tue Oct 31 03:06:00 2023"},{"name":"c","type":"text","value":"Crypturellus parvirostris"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.900}],"pk":[{"name":"g","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"U","schema":"public","table":"w2j_rename_pk","columns":[{"name":"g","type":"integer","value":890},{"name":"b","type":"timestamp without time zone","value":"Tue Oct 31 03:06:00 2023"},{"name":"c","type":"text","value":"Crypturellus parvirostris"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.910}],"identity":[{"name":"g","type":"integer","value":890},{"name":"b","type":"timestamp without time zone","value":"Tue Oct 31 03:06:00 2023"},{"name":"c","type":"text","value":"Crypturellus parvirostris"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.900}],"pk":[{"name":"g","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} + {"action":"B"} + {"action":"D","schema":"public","table":"w2j_rename_pk","identity":[{"name":"g","type":"integer","value":890},{"name":"b","type":"timestamp without time zone","value":"Tue Oct 31 03:06:00 2023"},{"name":"c","type":"text","value":"Crypturellus parvirostris"},{"name":"f","type":"boolean","value":true},{"name":"e","type":"numeric(5,3)","value":8.910}],"pk":[{"name":"g","type":"integer"},{"name":"f","type":"boolean"}]} + {"action":"C"} +(49 rows) SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); ?column? diff --git a/sql/rename_column.sql b/sql/rename_column.sql index 2443baa60388..0101ab41c3c4 100644 --- a/sql/rename_column.sql +++ b/sql/rename_column.sql @@ -55,6 +55,12 @@ INSERT INTO w2j_rename_ri (g, b, c, f, e) VALUES(790, '2020-04-04 10:34:55', 'My UPDATE w2j_rename_ri SET e = 3.1415 WHERE g = 456; COMMIT; +ALTER TABLE w2j_rename_pk REPLICA IDENTITY FULL; +INSERT INTO w2j_rename_pk (g, b, c, f, e) VALUES(890, '2023-10-31 03:06:00', 'Crypturellus parvirostris', true, 8.90); +UPDATE w2j_rename_pk SET e = 8.91 WHERE g = 890; +DELETE FROM w2j_rename_pk WHERE g = 890; + + SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '1', 'pretty-print', '1', 'include-typmod', '0', 'include-pk', '1'); SELECT data FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'format-version', '2', 'include-pk', '1'); SELECT 'stop' FROM pg_drop_replication_slot('regression_slot'); diff --git a/wal2json.c b/wal2json.c index 0bcaec96fda2..a4922c9bd683 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1857,8 +1857,12 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, { case REORDER_BUFFER_CHANGE_INSERT: /* Print the new tuple */ +#if PG_VERSION_NUM >= 100000 + if (data->include_pk && OidIsValid(relation->rd_pkindex)) +#else if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) +#endif { columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, false); @@ -1871,9 +1875,15 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); +#if PG_VERSION_NUM >= 100000 + if (data->include_pk && OidIsValid(relation->rd_pkindex)) +#else if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) +#endif + { pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); + } /* * The old tuple is available when: @@ -1898,9 +1908,15 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, } break; case REORDER_BUFFER_CHANGE_DELETE: +#if PG_VERSION_NUM >= 100000 + if (data->include_pk && OidIsValid(relation->rd_pkindex)) +#else if (data->include_pk && OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) +#endif + { pk_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, pkbs, true); + } ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, ribs); From b10dca4b6f226c5f6528f440a7d96e51b023f9b5 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 20 Apr 2024 18:58:00 -0300 Subject: [PATCH 136/154] Update instructions with the latest PostgreSQL version wal2json supports up to the latest supported version: 16. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3fd55ed3e91f..35b1c00d09cb 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ This extension is supported on [those platforms](http://www.postgresql.org/docs/ In Red Hat/CentOS: ``` -$ sudo yum install wal2json14 +$ sudo yum install wal2json16 ``` In Debian/Ubuntu: ``` -$ sudo apt-get install postgresql-14-wal2json +$ sudo apt-get install postgresql-16-wal2json ``` You can also keep up with the latest fixes and features cloning the Git repository. @@ -35,14 +35,14 @@ $ git clone https://github.com/eulerto/wal2json.git Unix based Operating Systems ---------------------------- -Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql14-devel` and add `/usr/pgsql-14/bin` to your search path (yum uses `14, 13, 12, 11, 10, 96 or 95`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-14` and add `/usr/lib/postgresql/14/bin` to your search path. (apt uses `14, 13, 12, 11, 10, 9.6 or 9.5`). +Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (including the header files). If PostgreSQL is not in your search path, add it. If you are using [PostgreSQL yum repository](https://yum.postgresql.org), install `postgresql16-devel` and add `/usr/pgsql-16/bin` to your search path (yum uses `16, 15, 14, 13, 12, 11, 10, 96 or 95`). If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt), install `postgresql-server-dev-16` and add `/usr/lib/postgresql/16/bin` to your search path. (apt uses `16, 15, 14, 13, 12, 11, 10, 9.6 or 9.5`). -If you compile PostgreSQL by yourself and install it in `/home/euler/pg14`: +If you compile PostgreSQL by yourself and install it in `/home/euler/pg16`: ``` $ tar -zxf wal2json-wal2json_2_5.tar.gz $ cd wal2json-wal2json_2_5 -$ export PATH=/home/euler/pg14/bin:$PATH +$ export PATH=/home/euler/pg16/bin:$PATH $ make $ make install ``` @@ -50,10 +50,10 @@ $ make install If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` -$ sudo yum install postgresql14-devel +$ sudo yum install postgresql16-devel $ tar -zxf wal2json-wal2json_2_5.tar.gz $ cd wal2json-wal2json_2_5 -$ export PATH=/usr/pgsql-14/bin:$PATH +$ export PATH=/usr/pgsql-16/bin:$PATH $ make $ make install ``` @@ -61,10 +61,10 @@ $ make install If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Apt): ``` -$ sudo apt-get install postgresql-server-dev-14 +$ sudo apt-get install postgresql-server-dev-16 $ tar -zxf wal2json-wal2json_2_5.tar.gz $ cd wal2json-wal2json_2_5 -$ export PATH=/usr/lib/postgresql/14/bin:$PATH +$ export PATH=/usr/lib/postgresql/16/bin:$PATH $ make $ make install ``` From 2468b8379dfb4cee24e9adc4d364b9e386aa70b5 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 20 Apr 2024 19:20:12 -0300 Subject: [PATCH 137/154] Fix Red Hat package name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35b1c00d09cb..f1bfc5fe73b0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This extension is supported on [those platforms](http://www.postgresql.org/docs/ In Red Hat/CentOS: ``` -$ sudo yum install wal2json16 +$ sudo yum install wal2json_16 ``` In Debian/Ubuntu: From 98835432bd190642b59f94dedd80bf4bac8e1b62 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 20 Apr 2024 19:27:49 -0300 Subject: [PATCH 138/154] Update copyright year --- LICENSE | 2 +- README.md | 2 +- wal2json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index b1ade67bf54a..e3e82163fc09 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2022, Euler Taveira de Oliveira +Copyright (c) 2013-2024, Euler Taveira de Oliveira All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index f1bfc5fe73b0..261c1326da15 100644 --- a/README.md +++ b/README.md @@ -497,7 +497,7 @@ DROP TABLE License ======= -> Copyright (c) 2013-2022, Euler Taveira de Oliveira +> Copyright (c) 2013-2024, Euler Taveira de Oliveira > All rights reserved. > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/wal2json.c b/wal2json.c index a4922c9bd683..e9f2d87bef90 100644 --- a/wal2json.c +++ b/wal2json.c @@ -3,7 +3,7 @@ * wal2json.c * JSON output plugin for changeset extraction * - * Copyright (c) 2013-2022, Euler Taveira de Oliveira + * Copyright (c) 2013-2024, Euler Taveira de Oliveira * * IDENTIFICATION * contrib/wal2json/wal2json.c From 375c28659ef39c3973df37af99fabf44c95a96e2 Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Sat, 20 Apr 2024 21:37:53 -0300 Subject: [PATCH 139/154] Add PostgreSQL 17 support Postgres 17 changed the ReorderBufferChange data structure (commit postgres/postgres@08e6344fd6423210b339e92c069bb979ba4e7cd6). --- wal2json.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/wal2json.c b/wal2json.c index e9f2d87bef90..a1b8a6160593 100644 --- a/wal2json.c +++ b/wal2json.c @@ -1864,17 +1864,31 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) #endif { +#if PG_VERSION_NUM >= 170000 + columns_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, true, relation); + pk_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, pkbs, false); +#else columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, false); +#endif } else { +#if PG_VERSION_NUM >= 170000 + columns_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, false, relation); +#else columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, false, relation); +#endif } break; case REORDER_BUFFER_CHANGE_UPDATE: /* Print the new tuple */ +#if PG_VERSION_NUM >= 170000 + columns_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, true, relation); +#else columns_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, true, relation); +#endif + #if PG_VERSION_NUM >= 100000 if (data->include_pk && OidIsValid(relation->rd_pkindex)) #else @@ -1882,7 +1896,11 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) #endif { +#if PG_VERSION_NUM >= 170000 + pk_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, pkbs, true); +#else pk_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, pkbs, true); +#endif } /* @@ -1899,12 +1917,20 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, elog(DEBUG1, "old tuple is null"); ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); +#if PG_VERSION_NUM >= 170000 + identity_to_stringinfo(ctx, tupdesc, change->data.tp.newtuple, ribs); +#else identity_to_stringinfo(ctx, tupdesc, &change->data.tp.newtuple->tuple, ribs); +#endif } else { elog(DEBUG1, "old tuple is not null"); +#if PG_VERSION_NUM >= 170000 + identity_to_stringinfo(ctx, tupdesc, change->data.tp.oldtuple, NULL); +#else identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, NULL); +#endif } break; case REORDER_BUFFER_CHANGE_DELETE: @@ -1915,11 +1941,19 @@ pg_decode_change_v1(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) #endif { +#if PG_VERSION_NUM >= 170000 + pk_to_stringinfo(ctx, tupdesc, change->data.tp.oldtuple, pkbs, true); +#else pk_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, pkbs, true); +#endif } ribs = RelationGetIndexAttrBitmap(relation, INDEX_ATTR_BITMAP_IDENTITY_KEY); +#if PG_VERSION_NUM >= 170000 + identity_to_stringinfo(ctx, tupdesc, change->data.tp.oldtuple, ribs); +#else identity_to_stringinfo(ctx, tupdesc, &change->data.tp.oldtuple->tuple, ribs); +#endif if (change->data.tp.oldtuple == NULL) elog(DEBUG1, "old tuple is null"); @@ -2375,7 +2409,11 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (change->data.tp.newtuple != NULL) { appendStringInfoString(ctx->out, ",\"columns\":["); +#if PG_VERSION_NUM >= 170000 + pg_decode_write_tuple(ctx, relation, change->data.tp.newtuple, PGOUTPUTJSON_CHANGE); +#else pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_CHANGE); +#endif appendStringInfoChar(ctx->out, ']'); } @@ -2395,7 +2433,11 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (change->data.tp.oldtuple != NULL) { appendStringInfoString(ctx->out, ",\"identity\":["); +#if PG_VERSION_NUM >= 170000 + pg_decode_write_tuple(ctx, relation, change->data.tp.oldtuple, PGOUTPUTJSON_IDENTITY); +#else pg_decode_write_tuple(ctx, relation, &change->data.tp.oldtuple->tuple, PGOUTPUTJSON_IDENTITY); +#endif appendStringInfoChar(ctx->out, ']'); } else @@ -2420,7 +2462,11 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat { elog(DEBUG1, "REPLICA IDENTITY: obtain old tuple using new tuple"); appendStringInfoString(ctx->out, ",\"identity\":["); +#if PG_VERSION_NUM >= 170000 + pg_decode_write_tuple(ctx, relation, change->data.tp.newtuple, PGOUTPUTJSON_IDENTITY); +#else pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_IDENTITY); +#endif appendStringInfoChar(ctx->out, ']'); } else @@ -2446,10 +2492,17 @@ pg_decode_write_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relat if (OidIsValid(relation->rd_replidindex) && relation->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT) #endif { +#if PG_VERSION_NUM >= 170000 + if (change->data.tp.oldtuple != NULL) + pg_decode_write_tuple(ctx, relation, change->data.tp.oldtuple, PGOUTPUTJSON_PK); + else + pg_decode_write_tuple(ctx, relation, change->data.tp.newtuple, PGOUTPUTJSON_PK); +#else if (change->data.tp.oldtuple != NULL) pg_decode_write_tuple(ctx, relation, &change->data.tp.oldtuple->tuple, PGOUTPUTJSON_PK); else pg_decode_write_tuple(ctx, relation, &change->data.tp.newtuple->tuple, PGOUTPUTJSON_PK); +#endif } appendStringInfoChar(ctx->out, ']'); } From 7f75b331d570ccbed91e377bc76561a34fcc352d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Mon, 22 Apr 2024 15:47:33 -0300 Subject: [PATCH 140/154] Update build infrastructure for Windows It updates MS Visual Studio from 2017 (v141) to 2022 (v143). It also changes the target OS from 8.1 to 10.0 because Windows 8 was EOL for some time (Windows 10 is also deprecated 3 months ago but since it is the one I used to test these builds, I kept it. Feel free to update WindowsTargetPlatformVersion if you are using a newer Windows version.) It also includes a solution file (wal2json.sln -- although there aren't multiple project files) that you can also use to trigger the build using the following command: msbuild wal2json.sln /verbosity:normal /p:Configuration=Release I tested these builds with Postgres 10 and later on x86_64. --- README.md | 2 +- wal2json.sln | 31 +++++++++++++++++++++++++++++++ wal2json.vcxproj | 20 ++++++++++---------- 3 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 wal2json.sln diff --git a/README.md b/README.md index 261c1326da15..42e495cb6431 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ $ make install Windows ------- -There are several ways to build **wal2json** on Windows. If you are build PostgreSQL too, you can put **wal2json** directory inside contrib, change the contrib Makefile (variable SUBDIRS) and build it following the [Installation from Source Code on Windows](http://www.postgresql.org/docs/current/static/install-windows.html) instructions. However, if you already have PostgreSQL installed, it is also possible to compile **wal2json** out of the tree. Edit `wal2json.vcxproj` file and change `c:\postgres\pg103` to the PostgreSQL prefix directory. The next step is to open this project file in MS Visual Studio and compile it. Final step is to copy `wal2json.dll` to the `pg_config --pkglibdir` directory. +There are several ways to build **wal2json** on Windows. If you are build PostgreSQL too, you can put **wal2json** directory inside contrib, change the contrib Makefile (variable SUBDIRS) and build it following the [Installation from Source Code on Windows](http://www.postgresql.org/docs/current/static/install-windows.html) instructions. However, if you already have PostgreSQL installed, it is also possible to compile **wal2json** out of the tree. Edit `wal2json.vcxproj` file and change `c:\pg\16` to the PostgreSQL prefix directory. The next step is to open this project file in MS Visual Studio and compile it. Final step is to copy `wal2json.dll` to the `pg_config --pkglibdir` directory. Configuration ============= diff --git a/wal2json.sln b/wal2json.sln new file mode 100644 index 000000000000..203a006dead6 --- /dev/null +++ b/wal2json.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wal2json", "wal2json.vcxproj", "{D10508A0-6575-4EE9-9AD9-4BC161A5E934}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Debug|x64.ActiveCfg = Debug|x64 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Debug|x64.Build.0 = Debug|x64 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Debug|x86.ActiveCfg = Debug|Win32 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Debug|x86.Build.0 = Debug|Win32 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Release|x64.ActiveCfg = Release|x64 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Release|x64.Build.0 = Release|x64 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Release|x86.ActiveCfg = Release|Win32 + {D10508A0-6575-4EE9-9AD9-4BC161A5E934}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {542A3CD9-759C-4DB6-B7CD-8E51866EFCC0} + EndGlobalSection +EndGlobal diff --git a/wal2json.vcxproj b/wal2json.vcxproj index 1c16609605e9..09933e349846 100644 --- a/wal2json.vcxproj +++ b/wal2json.vcxproj @@ -11,21 +11,21 @@ - 15.0 + 17.0 {185AF5B6-C04A-4710-8330-18A4416BD225} Win32Proj - 8.1 + 10.0 DynamicLibrary true - v141 + v143 DynamicLibrary false - v141 + v143 @@ -47,8 +47,8 @@ - C:\postgres\pg103\include\server\port\win32_msvc;C:\postgres\pg103\include\server\port\win32;C:\postgres\pg103\include\server;C:\postgres\pg103\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG=1%(PreprocessorDefinitions) + C:\pg\16\include\server\port\win32_msvc;C:\pg\16\include\server\port\win32;C:\pg\16\include\server;C:\pg\16\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;__WINDOWS__;__WIN32__;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG=1%(PreprocessorDefinitions) false MultiThreadedDebugDLL 4018;4244;4273;4102;4090;4267;%(DisableSpecificWarnings) @@ -57,7 +57,7 @@ .\x64\Debug\wal2json.dll - C:\postgres\pg103\lib;%(AdditionalLibraryDirectories) + C:\pg\16\lib;%(AdditionalLibraryDirectories) postgres.lib;libpgcommon.lib;libpgport.lib;%(AdditionalDependencies) MachineX64 /ignore:4197 %(AdditionalOptions) @@ -68,7 +68,7 @@ - C:\postgres\pg103\include\server\port\win32_msvc;C:\postgres\pg103\include\server\port\win32;C:\postgres\pg103\include\server;C:\postgres\pg103\include;%(AdditionalIncludeDirectories) + C:\pg\16\include\server\port\win32_msvc;C:\pg\16\include\server\port\win32;C:\pg\16\include\server;C:\pg\16\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG=1%(PreprocessorDefinitions) false MultiThreadedDebugDLL @@ -78,7 +78,7 @@ .\x64\Release\wal2json.dll - C:\postgres\pg103\lib;%(AdditionalLibraryDirectories) + C:\pg\16\lib;%(AdditionalLibraryDirectories) postgres.lib;libpgcommon.lib;libpgport.lib;%(AdditionalDependencies) MachineX64 /ignore:4197 %(AdditionalOptions) @@ -93,4 +93,4 @@ - \ No newline at end of file + From 75629c2e1e81a12350cc9d63782fc53252185d8d Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 24 Apr 2024 22:02:38 -0300 Subject: [PATCH 141/154] Stamp 2.6 --- README.md | 12 ++++++------ wal2json.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 42e495cb6431..ca791a0516fb 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Before installing **wal2json**, you should have PostgreSQL 9.4+ installed (inclu If you compile PostgreSQL by yourself and install it in `/home/euler/pg16`: ``` -$ tar -zxf wal2json-wal2json_2_5.tar.gz -$ cd wal2json-wal2json_2_5 +$ tar -zxf wal2json-wal2json_2_6.tar.gz +$ cd wal2json-wal2json_2_6 $ export PATH=/home/euler/pg16/bin:$PATH $ make $ make install @@ -51,8 +51,8 @@ If you are using [PostgreSQL yum repository](https://yum.postgresql.org): ``` $ sudo yum install postgresql16-devel -$ tar -zxf wal2json-wal2json_2_5.tar.gz -$ cd wal2json-wal2json_2_5 +$ tar -zxf wal2json-wal2json_2_6.tar.gz +$ cd wal2json-wal2json_2_6 $ export PATH=/usr/pgsql-16/bin:$PATH $ make $ make install @@ -62,8 +62,8 @@ If you are using [PostgreSQL apt repository](https://wiki.postgresql.org/wiki/Ap ``` $ sudo apt-get install postgresql-server-dev-16 -$ tar -zxf wal2json-wal2json_2_5.tar.gz -$ cd wal2json-wal2json_2_5 +$ tar -zxf wal2json-wal2json_2_6.tar.gz +$ cd wal2json-wal2json_2_6 $ export PATH=/usr/lib/postgresql/16/bin:$PATH $ make $ make install diff --git a/wal2json.c b/wal2json.c index a1b8a6160593..0c6295dcbe54 100644 --- a/wal2json.c +++ b/wal2json.c @@ -34,8 +34,8 @@ #include "utils/rel.h" #include "utils/syscache.h" -#define WAL2JSON_VERSION "2.5dev" -#define WAL2JSON_VERSION_NUM 205 +#define WAL2JSON_VERSION "2.6" +#define WAL2JSON_VERSION_NUM 206 #define WAL2JSON_FORMAT_VERSION 2 #define WAL2JSON_FORMAT_MIN_VERSION 1 From 5a76f6a8ff902ad40651320d9b4156739da845ed Mon Sep 17 00:00:00 2001 From: Sumukh-Phalgaonkar Date: Fri, 19 Jul 2024 15:36:19 +0530 Subject: [PATCH 142/154] [#23179] CDCSDK: Support data types with dynamically alloted oids in CDC Summary: This diff adds support for data types with dynamically alloted oids in CDC (for ex: hstore, enum array, etc). Such types contain invalid pg_type_oid for the corresponding columns in docdb schema. In the current implemtation, in `ybc_pggate`, while decoding the cdc records we look at the `type_map_` to obtain YBCPgTypeEntity, which is then used for decoding. However the `type_map_` does not contain any entries for the data types with dynamically alloted oids. As a result, this causes segmentation fault. To prevent such crashes, CDC prevents addition of tables with such columns to the stream. This diff removes the filtering logic and adds the tables to the stream even if it has such a type column. A function pointer will now be passed to `YBCPgGetCDCConsistentChanges`, which takes attribute number and the table_oid and returns the appropriate type entity by querying the `pg_type` catalog table. While decoding if a column is encountered with invalid pg_type_oid then, the passed function is invoked and type entity is obtained for decoding. **Upgrade/Rollback safety:** This diff adds a field `optional int32 attr_num` to DatumMessagePB. These changes are protected by the autoflag `ysql_yb_enable_replication_slot_consumption` which already exists but has not yet been released. Jira: DB-12118 Test Plan: Jenkins: urgent All the existing cdc tests ./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#replicationConnectionConsumptionAllDataTypesWithYbOutput' Reviewers: skumar, stiwary, asrinivasan, dmitry Reviewed By: stiwary, dmitry Subscribers: steve.varnau, skarri, yql, ybase, ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36689 --- .../org/yb/pgsql/TestPgReplicationSlot.java | 30 ++++++++++++---- src/postgres/src/backend/commands/ybccmds.c | 5 +-- .../logical/yb_virtual_wal_client.c | 23 ++++++++++++- src/postgres/src/include/commands/ybccmds.h | 3 +- src/yb/cdc/cdcsdk_producer.cc | 1 + src/yb/common/common.proto | 2 ++ src/yb/integration-tests/cdcsdk_ysql-test.cc | 13 ------- src/yb/master/master_xrepl-test.cc | 19 ++++++----- src/yb/master/xrepl_catalog_manager.cc | 18 ++++------ src/yb/yql/pggate/ybc_pggate.cc | 34 +++++++++++++------ src/yb/yql/pggate/ybc_pggate.h | 4 ++- 11 files changed, 97 insertions(+), 55 deletions(-) diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java index 2c73dd859e78..4fe714230623 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java @@ -919,9 +919,12 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce + "col_tsrange TSRANGE, " + "col_tstzrange TSTZRANGE, " + "col_daterange DATERANGE, " - + "col_discount coupon_discount_type)"; + + "col_hstore HSTORE, " + + "col_discount coupon_discount_type, " + +" col_discount_array coupon_discount_type[])"; try (Statement stmt = connection.createStatement()) { + stmt.execute("CREATE EXTENSION IF NOT EXISTS hstore;"); stmt.execute("CREATE TYPE coupon_discount_type AS ENUM ('FIXED', 'PERCENTAGE');"); stmt.execute(create_stmt); if (pluginName.equals(PG_OUTPUT_PLUGIN_NAME)) { @@ -947,7 +950,8 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce + "'550e8400-e29b-41d4-a716-446655440000', B'101010', '2024-02-01 12:34:56+00:00', " + "'[1,10)', '[100,1000)', '[2024-01-01, 2024-12-31)', " + "'[2024-01-01 00:00:00+00:00, 2024-12-31 15:59:59+00:00)', " - + "'[2024-01-01, 2024-12-31)', 'FIXED');"); + + "'[2024-01-01, 2024-12-31)','key1 => value1, key2 => value2'::hstore, 'FIXED', " + + "array['FIXED', 'PERCENTAGE']::coupon_discount_type[]);"); } PGReplicationStream stream = replConnection.replicationStream() @@ -960,12 +964,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce List result = new ArrayList(); // 1 Relation, begin, type, insert and commit record. - result.addAll(receiveMessage(stream, 5)); + result.addAll(receiveMessage(stream, 7)); List expectedResult = new ArrayList() { { add(PgOutputBeginMessage.CreateForComparison(LogSequenceNumber.valueOf("0/4"), 2)); + add(PgOutputTypeMessage.CreateForComparison("public", "hstore")); add(PgOutputTypeMessage.CreateForComparison("public", "coupon_discount_type")); + add(PgOutputTypeMessage.CreateForComparison("public", "_coupon_discount_type")); if (pluginName.equals(YB_OUTPUT_PLUGIN_NAME)) { add(PgOutputRelationMessage.CreateForComparison("public", "test_table", 'c', Arrays.asList(PgOutputRelationMessageColumn.CreateForComparison("a", 23), @@ -1003,8 +1009,12 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce PgOutputRelationMessageColumn.CreateForComparison("col_tsrange", 3908), PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910), PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912), + // The Oids for columns below are not fixed. Changing the order of creation of + // objects (extensions, tables etc.) in the test will these Oids. + PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385), PgOutputRelationMessageColumn.CreateForComparison( - "col_discount", /* IGNORED */ 0, /* compareDataType */ false)))); + "col_discount", 16518, /* compareDataType */ false), + PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517)))); } else { // The replica identity for test_table in case of pgoutput is DEFAULT. add(PgOutputRelationMessage.CreateForComparison("public", "test_table", 'd', @@ -1043,10 +1053,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce PgOutputRelationMessageColumn.CreateForComparison("col_tsrange", 3908), PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910), PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912), + // The Oids for columns below are not fixed. Changing the order of creation of + // objects (extensions, tables etc.) in the test will these Oids. + PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385), PgOutputRelationMessageColumn.CreateForComparison( - "col_discount", /* IGNORED */ 0, /* compareDataType */ false)))); + "col_discount", 16518, /* compareDataType */ false), + PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517)))); } - add(PgOutputInsertMessage.CreateForComparison(new PgOutputMessageTuple((short) 36, + add(PgOutputInsertMessage.CreateForComparison(new PgOutputMessageTuple((short) 38, Arrays.asList(new PgOutputMessageTupleColumnValue("1"), new PgOutputMessageTupleColumnValue("110110"), new PgOutputMessageTupleColumnValue("t"), @@ -1086,7 +1100,9 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce convertTimestampToSystemTimezone("2024-01-01T00:00:00.00Z"), convertTimestampToSystemTimezone("2024-12-31T15:59:59.00Z"))), new PgOutputMessageTupleColumnValue("[2024-01-01,2024-12-31)"), - new PgOutputMessageTupleColumnValue("FIXED"))))); + new PgOutputMessageTupleColumnValue("\"key1\"=>\"value1\", \"key2\"=>\"value2\""), + new PgOutputMessageTupleColumnValue("FIXED"), + new PgOutputMessageTupleColumnValue("{FIXED,PERCENTAGE}"))))); add(PgOutputCommitMessage.CreateForComparison( LogSequenceNumber.valueOf("0/4"), LogSequenceNumber.valueOf("0/5"))); } diff --git a/src/postgres/src/backend/commands/ybccmds.c b/src/postgres/src/backend/commands/ybccmds.c index aa7a2b1076a8..7828231df919 100644 --- a/src/postgres/src/backend/commands/ybccmds.c +++ b/src/postgres/src/backend/commands/ybccmds.c @@ -2030,9 +2030,10 @@ YBCDestroyVirtualWalForCDC() void YBCGetCDCConsistentChanges(const char *stream_id, - YBCPgChangeRecordBatch **record_batch) + YBCPgChangeRecordBatch **record_batch, + YBCTypeEntityProvider type_entity_provider) { - HandleYBStatus(YBCPgGetCDCConsistentChanges(stream_id, record_batch)); + HandleYBStatus(YBCPgGetCDCConsistentChanges(stream_id, record_batch, type_entity_provider)); } void diff --git a/src/postgres/src/backend/replication/logical/yb_virtual_wal_client.c b/src/postgres/src/backend/replication/logical/yb_virtual_wal_client.c index e05ee247f8c1..31cacf0e6f81 100644 --- a/src/postgres/src/backend/replication/logical/yb_virtual_wal_client.c +++ b/src/postgres/src/backend/replication/logical/yb_virtual_wal_client.c @@ -26,6 +26,7 @@ #include #include "access/xact.h" +#include "catalog/yb_type.h" #include "commands/ybccmds.h" #include "pg_yb_utils.h" #include "replication/slot.h" @@ -240,6 +241,26 @@ InitVirtualWal(List *publication_names) list_free(tables); } +static const YBCPgTypeEntity * +GetDynamicTypeEntity(int attr_num, Oid relid) +{ + bool is_in_txn = IsTransactionOrTransactionBlock(); + if (!is_in_txn) + StartTransactionCommand(); + + Relation rel = RelationIdGetRelation(relid); + if (!RelationIsValid(rel)) + elog(ERROR, "Could not open relation with OID %u", relid); + Oid type_oid = GetTypeId(attr_num, RelationGetDescr(rel)); + RelationClose(rel); + const YBCPgTypeEntity* type_entity = YbDataTypeFromOidMod(attr_num, type_oid); + + if (!is_in_txn) + AbortCurrentTransaction(); + + return type_entity; +} + YBCPgVirtualWalRecord * YBCReadRecord(XLogReaderState *state, XLogRecPtr RecPtr, List *publication_names, char **errormsg) @@ -293,7 +314,7 @@ YBCReadRecord(XLogReaderState *state, XLogRecPtr RecPtr, } YBCGetCDCConsistentChanges(MyReplicationSlot->data.yb_stream_id, - &cached_records); + &cached_records, &GetDynamicTypeEntity); cached_records_last_sent_row_idx = 0; YbWalSndTotalTimeInYBDecodeMicros = 0; diff --git a/src/postgres/src/include/commands/ybccmds.h b/src/postgres/src/include/commands/ybccmds.h index d243c2c96e18..17f1c8104231 100644 --- a/src/postgres/src/include/commands/ybccmds.h +++ b/src/postgres/src/include/commands/ybccmds.h @@ -143,7 +143,8 @@ extern void YBCUpdatePublicationTableList(const char *stream_id, extern void YBCDestroyVirtualWalForCDC(); extern void YBCGetCDCConsistentChanges(const char *stream_id, - YBCPgChangeRecordBatch **record_batch); + YBCPgChangeRecordBatch **record_batch, + YBCTypeEntityProvider type_entity_provider); extern void YBCUpdateAndPersistLSN(const char *stream_id, XLogRecPtr restart_lsn_hint, diff --git a/src/yb/cdc/cdcsdk_producer.cc b/src/yb/cdc/cdcsdk_producer.cc index b361ebfc16eb..629a854125c1 100644 --- a/src/yb/cdc/cdcsdk_producer.cc +++ b/src/yb/cdc/cdcsdk_producer.cc @@ -168,6 +168,7 @@ Status AddColumnToMap( // send NULL values to the walsender. This is needed to be able to differentiate between NULL // and Omitted values. if (request_source == CDCSDKRequestSource::WALSENDER) { + cdc_datum_message->set_col_attr_num(col_schema.order()); cdc_datum_message->set_column_type(col_schema.pg_type_oid()); cdc_datum_message->mutable_pg_ql_value()->CopyFrom(ql_value); return Status::OK(); diff --git a/src/yb/common/common.proto b/src/yb/common/common.proto index ffb7e59a729d..ee604b8ba84a 100644 --- a/src/yb/common/common.proto +++ b/src/yb/common/common.proto @@ -639,6 +639,8 @@ message DatumMessagePB { // The Walsender does the conversion from QLValuePB to the PG datum. QLValuePB pg_ql_value = 15; } + // This is applicable only for YSQL table columns. + optional int32 col_attr_num = 16; } message PgDatumPB { diff --git a/src/yb/integration-tests/cdcsdk_ysql-test.cc b/src/yb/integration-tests/cdcsdk_ysql-test.cc index bf61a34c2b0e..efec69bf592c 100644 --- a/src/yb/integration-tests/cdcsdk_ysql-test.cc +++ b/src/yb/integration-tests/cdcsdk_ysql-test.cc @@ -8611,19 +8611,6 @@ TEST_F(CDCSDKYsqlTest, TestNonEligibleTableShouldNotGetAddedToConsistentSnapshot TestNonEligibleTableShouldNotGetAddedToCDCStream(/* create_consistent_snapshot_stream */ true); } -TEST_F(CDCSDKYsqlTest, TestTablesWithEnumArrayColumnShouldNotGetAddedToStream) { - ASSERT_OK(SetUpWithParams(1, 1, false, false)); - auto conn = ASSERT_RESULT(test_cluster_.ConnectToDB(kNamespaceName)); - - ASSERT_OK(conn.Execute("CREATE TYPE \"enum_type\" AS ENUM('a', 'b', 'c');")); - ASSERT_OK(conn.Execute("CREATE TABLE test_table (a int primary key, b \"enum_type\"[])")); - auto stream_id = ASSERT_RESULT(CreateDBStream()); - - auto stream = ASSERT_RESULT(GetCDCStream(stream_id)); - // The table with enum array column will not be added to the stream. - ASSERT_EQ(stream.stream().table_id_size(), 0); -} - void CDCSDKYsqlTest::TestDisableOfDynamicTableAdditionOnCDCStream( bool use_consistent_snapshot_stream) { ANNOTATE_UNPROTECTED_WRITE(FLAGS_yb_enable_cdc_consistent_snapshot_streams) = diff --git a/src/yb/master/master_xrepl-test.cc b/src/yb/master/master_xrepl-test.cc index c3fbefb7de64..0f6a1966a3d1 100644 --- a/src/yb/master/master_xrepl-test.cc +++ b/src/yb/master/master_xrepl-test.cc @@ -556,7 +556,6 @@ TEST_F(MasterTestXRepl, YB_DISABLE_TEST_IN_TSAN(TestCDCStreamCreationWithOldReco CreateCDCStreamRequestPB req; CreateCDCStreamResponsePB resp; req.set_namespace_id(ns_id); - req.set_cdcsdk_ysql_replication_slot_name(kPgReplicationSlotName); AddKeyValueToCreateCDCStreamRequestOption(&req, cdc::kIdType, cdc::kNamespaceId); AddKeyValueToCreateCDCStreamRequestOption( &req, cdc::kSourceType, CDCRequestSource_Name(cdc::CDCRequestSource::CDCSDK)); @@ -574,7 +573,8 @@ TEST_F(MasterTestXRepl, TestCreateCDCStreamForNamespaceInvalidDuplicationSlotNam auto ns_id = create_namespace_resp.id(); for (auto i = 0; i < num_tables; ++i) { - ASSERT_OK(CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchema)); + ASSERT_OK( + CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchemaWithTypeOids)); } ASSERT_RESULT( @@ -644,7 +644,8 @@ TEST_F(MasterTestXRepl, TestCreateCDCStreamForNamespaceLimitReached) { auto ns_id = create_namespace_resp.id(); for (auto i = 0; i < num_tables; ++i) { - ASSERT_OK(CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchema)); + ASSERT_OK( + CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchemaWithTypeOids)); } ASSERT_RESULT( @@ -791,7 +792,8 @@ TEST_F(MasterTestXRepl, TestCreateDropCDCStreamWithReplicationSlotName) { ASSERT_OK(CreatePgsqlNamespace(kNamespaceName, kPgsqlNamespaceId, &create_namespace_resp)); auto ns_id = create_namespace_resp.id(); for (auto i = 0; i < num_tables; ++i) { - ASSERT_OK(CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchema)); + ASSERT_OK( + CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchemaWithTypeOids)); } // Create and Delete CDC stream with replication slot name in quick succession. @@ -845,9 +847,9 @@ TEST_F(MasterTestXRepl, TestListCDCStreamsCDCSDKWithReplicationSlot) { auto ns_id2 = create_namespace_resp.id(); // 2 tables in cdc_namespace and 1 table in cdc_namespace2 - ASSERT_OK(CreatePgsqlTable(ns_id, "cdc_table_1", kTableIds[0], kTableSchema)); - ASSERT_OK(CreatePgsqlTable(ns_id, "cdc_table_2", kTableIds[1], kTableSchema)); - ASSERT_OK(CreatePgsqlTable(ns_id2, "cdc_table_3", kTableIds[2], kTableSchema)); + ASSERT_OK(CreatePgsqlTable(ns_id, "cdc_table_1", kTableIds[0], kTableSchemaWithTypeOids)); + ASSERT_OK(CreatePgsqlTable(ns_id, "cdc_table_2", kTableIds[1], kTableSchemaWithTypeOids)); + ASSERT_OK(CreatePgsqlTable(ns_id2, "cdc_table_3", kTableIds[2], kTableSchemaWithTypeOids)); auto stream_id = ASSERT_RESULT( CreateCDCStreamForNamespace(ns_id, kPgReplicationSlotName, kPgReplicationSlotPgOutput)); @@ -1134,7 +1136,8 @@ TEST_F(MasterTestXRepl, DropNamespaceWithLiveCDCStream) { auto ns_id = create_namespace_resp.id(); for (auto i = 0; i < num_tables; ++i) { - ASSERT_OK(CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchema)); + ASSERT_OK( + CreatePgsqlTable(ns_id, Format("cdc_table_$0", i), kTableIds[i], kTableSchemaWithTypeOids)); } ASSERT_RESULT( CreateCDCStreamForNamespace(ns_id, kPgReplicationSlotName, kPgReplicationSlotPgOutput)); diff --git a/src/yb/master/xrepl_catalog_manager.cc b/src/yb/master/xrepl_catalog_manager.cc index 40f079ba43f3..b23dd192fdd7 100644 --- a/src/yb/master/xrepl_catalog_manager.cc +++ b/src/yb/master/xrepl_catalog_manager.cc @@ -1930,7 +1930,6 @@ bool CatalogManager::IsTableEligibleForCDCSDKStream( const TableInfoPtr& table_info, const std::optional& schema) const { if (schema.has_value()) { bool has_pk = true; - bool has_invalid_pg_typeoid = false; for (const auto& col : schema->columns()) { if (col.order() == static_cast(PgSystemAttrNum::kYBRowId)) { // ybrowid column is added for tables that don't have user-specified primary key. @@ -1939,19 +1938,16 @@ bool CatalogManager::IsTableEligibleForCDCSDKStream( has_pk = false; break; } - if (col.pg_type_oid() == 0) { - has_invalid_pg_typeoid = true; - } } - if (!has_pk || has_invalid_pg_typeoid) { - if (FLAGS_TEST_cdcsdk_add_indexes_to_stream) { - // allow adding user created indexes to CDC stream. - if (IsUserIndexUnlocked(*table_info)) { - return true; - } - } + + if (!has_pk) { return false; } + + // Allow adding user created indexes to CDC stream. + if (FLAGS_TEST_cdcsdk_add_indexes_to_stream && IsUserIndexUnlocked(*table_info)) { + return true; + } } if (IsMatviewTable(*table_info)) { diff --git a/src/yb/yql/pggate/ybc_pggate.cc b/src/yb/yql/pggate/ybc_pggate.cc index 556df16c6cba..ea0432602194 100644 --- a/src/yb/yql/pggate/ybc_pggate.cc +++ b/src/yb/yql/pggate/ybc_pggate.cc @@ -400,6 +400,14 @@ std::string HumanReadableTableType(yb::TableType table_type) { FATAL_INVALID_ENUM_VALUE(yb::TableType, table_type); } +const YBCPgTypeEntity* GetTypeEntity( + int pg_type_oid, int attr_num, YBCPgOid table_oid, YBCTypeEntityProvider type_entity_provider) { + + // TODO(23239): Optimize the lookup of type entities for dynamic types. + return pg_type_oid == kPgInvalidOid ? (*type_entity_provider)(attr_num, table_oid) + : pgapi->FindTypeEntity(pg_type_oid); +} + } // namespace //-------------------------------------------------------------------------------------------------- @@ -2425,7 +2433,9 @@ YBCPgRowMessageAction GetRowMessageAction(yb::cdc::RowMessage row_message_pb) { } YBCStatus YBCPgGetCDCConsistentChanges( - const char *stream_id, YBCPgChangeRecordBatch **record_batch) { + const char* stream_id, + YBCPgChangeRecordBatch** record_batch, + YBCTypeEntityProvider type_entity_provider) { const auto result = pgapi->GetConsistentChangesForCDC(std::string(stream_id)); if (!result.ok()) { return ToYBCStatus(result.status()); @@ -2484,6 +2494,10 @@ YBCStatus YBCPgGetCDCConsistentChanges( old_tuple_idx++; } + const auto table_oid = row_message_pb.has_table_id() + ? PgObjectId(row_message_pb.table_id()).object_oid + : kPgInvalidOid; + auto col_count = narrow_cast(col_name_idx_map.size()); YBCPgDatumMessage *cols = nullptr; if (col_count > 0) { @@ -2501,8 +2515,10 @@ YBCStatus YBCPgGetCDCConsistentChanges( if (!before_op_is_omitted) { const auto old_datum_pb = &row_message_pb.old_tuple(static_cast(col_idxs.second.first)); - const auto *type_entity = - pgapi->FindTypeEntity(static_cast(old_datum_pb->column_type())); + DCHECK(table_oid != kPgInvalidOid); + const auto* type_entity = GetTypeEntity( + static_cast(old_datum_pb->column_type()), old_datum_pb->col_attr_num(), + table_oid, type_entity_provider); auto s = PBToDatum( type_entity, type_attrs, old_datum_pb->pg_ql_value(), &before_op_datum, &before_op_is_null); @@ -2518,8 +2534,10 @@ YBCStatus YBCPgGetCDCConsistentChanges( if (!after_op_is_omitted) { const auto new_datum_pb = &row_message_pb.new_tuple(static_cast(col_idxs.second.second)); - const auto *type_entity = - pgapi->FindTypeEntity(static_cast(new_datum_pb->column_type())); + DCHECK(table_oid != kPgInvalidOid); + const auto* type_entity = GetTypeEntity( + static_cast(new_datum_pb->column_type()), new_datum_pb->col_attr_num(), + table_oid, type_entity_provider); auto s = PBToDatum( type_entity, type_attrs, new_datum_pb->pg_ql_value(), &after_op_datum, &after_op_is_null); @@ -2539,12 +2557,6 @@ YBCStatus YBCPgGetCDCConsistentChanges( } } - // Only present for DML records. - YBCPgOid table_oid = kPgInvalidOid; - if (row_message_pb.has_table_id()) { - auto table_id = PgObjectId(row_message_pb.table_id()); - table_oid = table_id.object_oid; - } new (&resp_rows[row_idx]) YBCPgRowMessage{ .col_count = col_count, diff --git a/src/yb/yql/pggate/ybc_pggate.h b/src/yb/yql/pggate/ybc_pggate.h index 12cf3c7f837d..fd082df1f87d 100644 --- a/src/yb/yql/pggate/ybc_pggate.h +++ b/src/yb/yql/pggate/ybc_pggate.h @@ -25,6 +25,7 @@ extern "C" { typedef void (*YBCAshAcquireBufferLock)(bool); typedef YBCAshSample* (*YBCAshGetNextCircularBufferSlot)(); +typedef const YBCPgTypeEntity* (*YBCTypeEntityProvider)(int, YBCPgOid); typedef void * SliceVector; typedef const void * ConstSliceVector; @@ -877,7 +878,8 @@ YBCStatus YBCPgUpdatePublicationTableList( YBCStatus YBCPgDestroyVirtualWalForCDC(); YBCStatus YBCPgGetCDCConsistentChanges(const char *stream_id, - YBCPgChangeRecordBatch **record_batch); + YBCPgChangeRecordBatch **record_batch, + YBCTypeEntityProvider type_entity_provider); YBCStatus YBCPgUpdateAndPersistLSN( const char* stream_id, YBCPgXLogRecPtr restart_lsn_hint, YBCPgXLogRecPtr confirmed_flush, From 5820ccd20833c5b7a2a3b69a8cc1d00b17bf5056 Mon Sep 17 00:00:00 2001 From: Subramanian Neelakantan Date: Fri, 19 Jul 2024 03:06:37 +0000 Subject: [PATCH 143/154] [PLAT-14710] Do not return apiToken in response to getSessionInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: **Context** The GET /session_info YBA API returns: { "authToken": "…", "apiToken": "….", "apiTokenVersion": "….", "customerUUID": "uuid1", "userUUID": "useruuid1" } The apiToken and apiTokenVersion is supposed to be the last generated token that is valid. We had the following sequence of changes to this API. https://yugabyte.atlassian.net/browse/PLAT-8028 - Do not store YBA token in YBA. After the above fix, YBA does not store the apiToken anymore. So it cannot return it as part of the /session_info. The change for this ticket returned the hashed apiToken instead. https://yugabyte.atlassian.net/browse/PLAT-14672 - getSessionInfo should generate and return api key in response Since the hashed apiToken value is not useful to any client, and it broke YBM create cluster (https://yugabyte.atlassian.net/browse/CLOUDGA-22117), the first change for this ticket returned a new apiToken instead. Note that GET /session_info is meant to get customer and user information for the currently authenticated session. This is useful for automation starting off an authenticated session from an existing/cached API token. It is not necessary for the /session_info API to return the authToken and apiToken. The client already has one of authToken or apiToken with which it invoked /session_info API. In fact generating a new apiToken whenever /session_info is called will invalidate the previous apiToken which would not be expected by the client. There is a different API /api_token to regenerate the apiToken explicitly. **Fix in this change** So the right behaviour is for /session_info to stop sending the apiToken in the response. In fact, the current behaviour of generating a new apiToken everytime will break a client (for example node-agent usage of /session_info here (https://github.com/yugabyte/yugabyte-db/blob/4ca56cfe27d1cae64e0e61a1bde22406e003ec04/managed/node-agent/app/server/handler.go#L19). **Client impact of not returning apiToken in response of /session_info** This should not impact any normal client that was using /session_info only to get the user uuid and customer uuid. However, there might be a few clients (like YBM for example) that invoked /session_info to get the last generated apiToken from YBA. Unfortunately, this was a mis-use of this API. YBA generates the apiToken in response to a few entry point APIs like /register, /api_login and /api_token. The apiToken is long lived. YBA could choose to expire these apiTokens after a fixed amount of (long) time, but for now there is no expiration. The clients are expected to store the apiToken at their end and use the token to reestablish a session with YBA whenever needed. After establishinig a new session, clients would call GET /session_info to get the user uuid and customer uuid. This is getting fixed in YBM with https://yugabyte.atlassian.net/browse/CLOUDGA-22117. So this PLAT change should be taken up by YBM only after CLOUDGA-22117 is fixed. Test Plan: * Manually verified that session_info does not return authToken * Shubham verified that node-agent works with this fix. Thanks Shubham! Reviewers: svarshney, dkumar, tbedi, #yba-api-review! Reviewed By: svarshney Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D36712 --- .../java/com/yugabyte/yw/controllers/SessionController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java b/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java index c22882d626f5..56d4343603b4 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java @@ -193,8 +193,8 @@ public Result getSessionInfo(Http.Request request) { SessionInfo sessionInfo = new SessionInfo( authCookie.isPresent() ? authCookie.get().value() : null, - user.upsertApiToken(), - user.getApiTokenVersion(), + null, + null, cust.getUuid(), user.getUuid()); return withData(sessionInfo); From dcfa9cd6460b4612de299c2dddfc318b2c788075 Mon Sep 17 00:00:00 2001 From: Aishwarya Chakravarthy Date: Mon, 22 Jul 2024 11:21:56 -0400 Subject: [PATCH 144/154] [docs] updates to CVE table status column (#23225) * updates to status column * review comment * format --------- Co-authored-by: Dwight Hodge --- .../secure/vulnerability-disclosure-policy.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/content/preview/secure/vulnerability-disclosure-policy.md b/docs/content/preview/secure/vulnerability-disclosure-policy.md index ad59bb679dc7..d28931b231cd 100644 --- a/docs/content/preview/secure/vulnerability-disclosure-policy.md +++ b/docs/content/preview/secure/vulnerability-disclosure-policy.md @@ -14,7 +14,7 @@ type: docs An important part of Yugabyte's strategy for building a secure platform for our users is vulnerability reporting. We value working with the broader security research community and understand that fostering that relationship will help Yugabyte improve its own security posture. We take vulnerabilities very seriously regardless of source, and strongly encourage people to report security vulnerabilities **privately to our security team** before disclosing them in a public forum. Our goal is to surface vulnerabilities and resolve them privately before they can be exploited. -## Our Commitment +## Our commitment 1. **In scope** We commit to investigate and address any reported issues, and request that you use the following process for the reporting of security vulnerabilities in the following products: @@ -30,7 +30,7 @@ An important part of Yugabyte's strategy for building a secure platform for our 1. We assure you that we will not initiate legal action against researchers who are acting in good faith and adhering to this process. -## The Process +## The process 1. **Report the Concern.** If you have any security concerns or would like to report undisclosed security vulnerabilities in our products or services, please email us at [security@yugabyte.com](mailto:security@yugabyte.com). Note that we do not accept bug reports at this address. @@ -49,7 +49,7 @@ An important part of Yugabyte's strategy for building a secure platform for our 1. **Use Common Sense.** Please use common sense when looking for security issues with our products. Attacking or compromising Yugabyte users' installations, or attacks on our infrastructure are not permitted. -## Next Steps +## Next steps 1. We will promptly investigate any reported issue. In certain cases, we may work privately with you to resolve the vulnerability. We may choose not to disclose information publicly while we investigate and mitigate any risk. @@ -81,18 +81,18 @@ Note that this policy covers only vulnerabilities in the query layer of PostgreS | Product | Name | Fixed in YugabyteDB version | Status | | :------ | :--- | :--------------------- | :----- | -| PostgreSQL (YSQL) | {{}} | | Not applicable | -| PostgreSQL (YSQL) | {{}} | | Not applicable | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB only runs on Linux, this vulnerability is Windows-specific. | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB only runs on Linux, this vulnerability is Windows-specific. | | PostgreSQL (YSQL) | {{}} | [v2.7.1](/preview/releases/ybdb-releases/end-of-life/v2.7/#v2-7-1-1-may-25-2021)| Resolved | | PostgreSQL (YSQL) | {{}} | [v2.12.11.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.11.0), {{}}, {{}} | Resolved | | PostgreSQL (YSQL) | {{}} | [v2.12.11.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.11.0), {{}}, {{}} | Resolved | | PostgreSQL (YSQL) | {{}} | [v2.12.11.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.11.0), {{}}, {{}} | Resolved | | PostgreSQL (YSQL) | {{}} | [v2.12.11.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.11.0), {{}}, {{}} | Resolved | -| PostgreSQL (YSQL) | {{}} | | Not applicable | -| PostgreSQL (YSQL) | {{}} | | Not applicable | -| PostgreSQL (YSQL) | {{}} | | Not applicable | -| PostgreSQL (YSQL) | {{}} | | Not applicable | -| PostgreSQL (YSQL) | {{}} | | Not applicable | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB only runs on Linux, this vulnerability is Windows-specific. | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB only runs on Linux, this vulnerability is Windows-specific. | +| PostgreSQL (YSQL) | {{}} | | Not applicable: pg_ctlcluster is not included in installation. | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB only runs on Linux, this vulnerability is Windows-specific. | +| PostgreSQL (YSQL) | {{}} | | Not applicable: YugabyteDB does not use logical replication. | | PostgreSQL (YSQL) | {{}} | [v2.12.11.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.11.0), {{}}, {{}}, {{}}| Resolved | | PostgreSQL (YSQL) | {{}} | | Resolved | | PostgreSQL (YSQL) | {{}} | [v2.7.1](/preview/releases/ybdb-releases/end-of-life/v2.7/#v2-7-1-1-may-25-2021) or later | Resolved | @@ -111,5 +111,5 @@ Note that this policy covers only vulnerabilities in the query layer of PostgreS | PostgreSQL (YSQL) | {{}} | [v2.12.10.0](/preview/releases/ybdb-releases/end-of-life/v2.12/#v2.12.10.0), {{}}, {{}}| Resolved | | PostgreSQL (YSQL) | {{}} | {{}}| Resolved | | PostgreSQL (YSQL) | {{}} | {{}}, {{}}, {{}}, {{}}| Resolved | -| PostgreSQL (YSQL) | {{}} | | Not applicable | +| PostgreSQL (YSQL) | {{}} | | Not applicable: [aiven-extras](https://github.com/aiven/aiven-extras) is not included in installation. | | PostgreSQL (YSQL) | {{}} | {{}}, {{}}, {{}}, {{}}| Resolved | From c0b1ee84af3518c6e2a72aee5af2be65a4c3fbdf Mon Sep 17 00:00:00 2001 From: ddorian Date: Mon, 22 Jul 2024 18:13:08 +0200 Subject: [PATCH 145/154] [docs] Fix load balance keyword in drivers page (#23253) [docs] Fix `load_balance` -> `load-balance` in jdbc driver [docs] Fix `load_balance` -> `loadBalance` in nodejs driver --- docs/content/preview/drivers-orms/java/yugabyte-jdbc.md | 2 +- .../content/preview/drivers-orms/nodejs/yugabyte-node-driver.md | 2 +- docs/content/stable/drivers-orms/java/yugabyte-jdbc.md | 2 +- docs/content/stable/drivers-orms/nodejs/yugabyte-node-driver.md | 2 +- docs/content/v2.18/drivers-orms/java/yugabyte-jdbc.md | 2 +- docs/content/v2.18/drivers-orms/nodejs/yugabyte-node-driver.md | 2 +- docs/content/v2.20/drivers-orms/java/yugabyte-jdbc.md | 2 +- docs/content/v2.20/drivers-orms/nodejs/yugabyte-node-driver.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/preview/drivers-orms/java/yugabyte-jdbc.md b/docs/content/preview/drivers-orms/java/yugabyte-jdbc.md index ee491682ee6f..6fc8324c76c3 100644 --- a/docs/content/preview/drivers-orms/java/yugabyte-jdbc.md +++ b/docs/content/preview/drivers-orms/java/yugabyte-jdbc.md @@ -126,7 +126,7 @@ The following table describes the connection parameters required to connect, inc | user | User connecting to the database | yugabyte | password | User password | yugabyte | `load-balance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' -| `yb-servers-refresh-interval` | If `load_balance` is true, the interval in seconds to refresh the servers list | 300 +| `yb-servers-refresh-interval` | If `load-balance` is true, the interval in seconds to refresh the servers list | 300 | `topology-keys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `load-balance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. The following is an example JDBC URL for connecting to YugabyteDB: diff --git a/docs/content/preview/drivers-orms/nodejs/yugabyte-node-driver.md b/docs/content/preview/drivers-orms/nodejs/yugabyte-node-driver.md index 44d1b4893ba7..31f31ad5138f 100644 --- a/docs/content/preview/drivers-orms/nodejs/yugabyte-node-driver.md +++ b/docs/content/preview/drivers-orms/nodejs/yugabyte-node-driver.md @@ -76,7 +76,7 @@ The following table describes the connection parameters required to connect, inc | user | Database user | yugabyte | | password | User password | yugabyte | | `loadBalance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' | -| `ybServersRefreshInterval` | If `load_balance` is true, the interval in seconds to refresh the node list | 300 +| `ybServersRefreshInterval` | If `loadBalance` is true, the interval in seconds to refresh the node list | 300 | `topologyKeys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `loadBalance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. | Create a client to connect to the cluster using a connection string. The following is an example connection string for connecting to a YugabyteDB cluster with uniform and topology load balancing: diff --git a/docs/content/stable/drivers-orms/java/yugabyte-jdbc.md b/docs/content/stable/drivers-orms/java/yugabyte-jdbc.md index 23eb355a5671..b3e861166617 100644 --- a/docs/content/stable/drivers-orms/java/yugabyte-jdbc.md +++ b/docs/content/stable/drivers-orms/java/yugabyte-jdbc.md @@ -121,7 +121,7 @@ The following table describes the connection parameters required to connect, inc | user | User connecting to the database | yugabyte | password | User password | yugabyte | `load-balance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' -| `yb-servers-refresh-interval` | If `load_balance` is true, the interval in seconds to refresh the servers list | 300 +| `yb-servers-refresh-interval` | If `load-balance` is true, the interval in seconds to refresh the servers list | 300 | `topology-keys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `load-balance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. The following is an example JDBC URL for connecting to YugabyteDB: diff --git a/docs/content/stable/drivers-orms/nodejs/yugabyte-node-driver.md b/docs/content/stable/drivers-orms/nodejs/yugabyte-node-driver.md index 1118e6af9031..35da9a937b49 100644 --- a/docs/content/stable/drivers-orms/nodejs/yugabyte-node-driver.md +++ b/docs/content/stable/drivers-orms/nodejs/yugabyte-node-driver.md @@ -76,7 +76,7 @@ The following table describes the connection parameters required to connect, inc | user | Database user | yugabyte | | password | User password | yugabyte | | `loadBalance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' | -| `ybServersRefreshInterval` | If `load_balance` is true, the interval in seconds to refresh the node list | 300 +| `ybServersRefreshInterval` | If `loadBalance` is true, the interval in seconds to refresh the node list | 300 | `topologyKeys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `loadBalance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. | Create a client to connect to the cluster using a connection string. The following is an example connection string for connecting to a YugabyteDB cluster with uniform and topology load balancing: diff --git a/docs/content/v2.18/drivers-orms/java/yugabyte-jdbc.md b/docs/content/v2.18/drivers-orms/java/yugabyte-jdbc.md index 5d31be202861..494ddd507f83 100644 --- a/docs/content/v2.18/drivers-orms/java/yugabyte-jdbc.md +++ b/docs/content/v2.18/drivers-orms/java/yugabyte-jdbc.md @@ -114,7 +114,7 @@ The following table describes the connection parameters required to connect, inc | user | User connecting to the database | yugabyte | password | User password | yugabyte | `load-balance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' -| `yb-servers-refresh-interval` | If `load_balance` is true, the interval in seconds to refresh the servers list | 300 +| `yb-servers-refresh-interval` | If `load-balance` is true, the interval in seconds to refresh the servers list | 300 | `topology-keys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `load-balance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. The following is an example JDBC URL for connecting to YugabyteDB: diff --git a/docs/content/v2.18/drivers-orms/nodejs/yugabyte-node-driver.md b/docs/content/v2.18/drivers-orms/nodejs/yugabyte-node-driver.md index 0c936d68fa0d..c395a1fdfa0f 100644 --- a/docs/content/v2.18/drivers-orms/nodejs/yugabyte-node-driver.md +++ b/docs/content/v2.18/drivers-orms/nodejs/yugabyte-node-driver.md @@ -76,7 +76,7 @@ The following table describes the connection parameters required to connect, inc | user | Database user | yugabyte | | password | User password | yugabyte | | `loadBalance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' | -| `ybServersRefreshInterval` | If `load_balance` is true, the interval in seconds to refresh the node list | 300 +| `ybServersRefreshInterval` | If `loadBalance` is true, the interval in seconds to refresh the node list | 300 | `topologyKeys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `loadBalance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. | Create a client to connect to the cluster using a connection string. The following is an example connection string for connecting to a YugabyteDB cluster with uniform and topology load balancing: diff --git a/docs/content/v2.20/drivers-orms/java/yugabyte-jdbc.md b/docs/content/v2.20/drivers-orms/java/yugabyte-jdbc.md index 277961d39963..31f719b477fc 100644 --- a/docs/content/v2.20/drivers-orms/java/yugabyte-jdbc.md +++ b/docs/content/v2.20/drivers-orms/java/yugabyte-jdbc.md @@ -114,7 +114,7 @@ The following table describes the connection parameters required to connect, inc | user | User connecting to the database | yugabyte | password | User password | yugabyte | `load-balance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' -| `yb-servers-refresh-interval` | If `load_balance` is true, the interval in seconds to refresh the servers list | 300 +| `yb-servers-refresh-interval` | If `load-balance` is true, the interval in seconds to refresh the servers list | 300 | `topology-keys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `load-balance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. The following is an example JDBC URL for connecting to YugabyteDB: diff --git a/docs/content/v2.20/drivers-orms/nodejs/yugabyte-node-driver.md b/docs/content/v2.20/drivers-orms/nodejs/yugabyte-node-driver.md index 9759e9271215..782c722ed5c1 100644 --- a/docs/content/v2.20/drivers-orms/nodejs/yugabyte-node-driver.md +++ b/docs/content/v2.20/drivers-orms/nodejs/yugabyte-node-driver.md @@ -76,7 +76,7 @@ The following table describes the connection parameters required to connect, inc | user | Database user | yugabyte | | password | User password | yugabyte | | `loadBalance` | [Uniform load balancing](../../smart-drivers/#cluster-aware-connection-load-balancing) | Defaults to upstream driver behavior unless set to 'true' | -| `ybServersRefreshInterval` | If `load_balance` is true, the interval in seconds to refresh the node list | 300 +| `ybServersRefreshInterval` | If `loadBalance` is true, the interval in seconds to refresh the node list | 300 | `topologyKeys` | [Topology-aware load balancing](../../smart-drivers/#topology-aware-connection-load-balancing) | If `loadBalance` is true, uses uniform load balancing unless set to comma-separated geo-locations in the form `cloud.region.zone`. | Create a client to connect to the cluster using a connection string. The following is an example connection string for connecting to a YugabyteDB cluster with uniform and topology load balancing: From 2becb4615d7aa0e6713e37ffa688ec5d8b488b92 Mon Sep 17 00:00:00 2001 From: Bvsk Patnaik Date: Mon, 22 Jul 2024 10:18:05 -0700 Subject: [PATCH 146/154] [docs] Add basic troubleshooting steps for read restart errors. (#23228) --- .../transactions/read-restart-error.md | 31 ++++++++++++++++++- .../transactions/read-restart-error.md | 31 ++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/docs/content/preview/architecture/transactions/read-restart-error.md b/docs/content/preview/architecture/transactions/read-restart-error.md index dd22c87623b4..ca08f91eeded 100644 --- a/docs/content/preview/architecture/transactions/read-restart-error.md +++ b/docs/content/preview/architecture/transactions/read-restart-error.md @@ -32,6 +32,35 @@ A detailed scenario that explains how clock skew can result in the above mention * It should return the data even if the client issued the read from a different node after writing the data, because the following guarantee needs to be maintained: the database should always return data that was committed in the past (past refers to the user-perceived past, and not based on machine clocks). - * It should not return the data if the write is performed in the future (that is, after the read point had been chosen) **and** had a write timestamp later than the read point. Because if that is allowed, everything written in future would be trivially visible to the read. Note that the latter condition is important because it is okay to return data that was written after the read point was picked, if the write timestamp was earlier than the read point (this doesn't break and consistency or isolation guarantees). + * It should not return the data if the write is performed in the future (that is, after the read point had been chosen) **and** had a write timestamp later than the read point. Because if that is allowed, everything written in future would be trivially visible to the read. Note that the latter condition is important because it is okay to return data that was written after the read point was picked, if the write timestamp was earlier than the read point (this doesn't break any consistency or isolation guarantees). * If node `N2` finds writes in the range `(T1, T1+max_clock_skew]`, to avoid breaking the strong guarantee that a reader should always be able to read what was committed earlier, and to avoid reading data with a later write timestamp which was also actually written after the read had been issued, node `N2` raises a `Read restart` error. + +## Troubleshooting + +You can handle and mitigate read restart errors using the following techniques: + +- Implement retry logic in the application. Application retries can help mitigate read restart errors. Moreover, a statement or a transaction may fail in other ways such as transaction conflicts or infrastructure failures. Therefore, a retry mechanism is strongly recommended for a cloud-native, distributed database such as YugabyteDB. +- Use SERIALIZABLE READ ONLY DEFERRABLE mode whenever possible. Read restart errors usually occur when the query is a SELECT statement with a large output footprint and there are concurrent writes that satisfy the SELECT statement. + + Using DEFERRABLE will avoid a read restart error altogether. However, the tradeoff is that the statement waits out the maximum permissible clock skew before reading the data (which is max_clock_skew_usec that has a default of 500ms). This is not an issue for large SELECT statements running in the background because latency is not a priority. + + Examples: + + Set transaction properties at the session level. + ```sql + SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; + SELECT * FROM large_table; + ``` + + Enclose the offending query within a transaction block. + ```sql + BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; + SELECT * FROM large_table; + COMMIT; + ``` +- Using read only, deferrable transactions is not always feasible, either because the query is not read only, or the query is part of a read-write transaction, or because an additional 500ms of latency is not acceptable. In these cases, try increasing the value of `ysql_output_buffer_size`. + + This will enable YugabyteDB to retry the query internally on behalf of the user. As long as the output of a statement hasn't crossed ysql_output_buffer_size to result in flushing partial data to the external client, the YSQL query layer retries read restart errors for all statements in a Read Committed transaction block, for the first statement in a Repeatable Read transaction block, and for any standalone statement outside a transaction block. As a tradeoff, increasing the buffer size also increases the memory consumed by the YSQL backend processes, resulting in a higher risk of out-of-memory errors. + + Be aware that increasing `ysql_output_buffer_size` is not a silver bullet. For example, the COPY command can still raise a read restart error even though the command has a one line output. Increasing `ysql_output_buffer_size` is not useful in this scenario. The application must retry the COPY command instead. Another example is DMLs such as INSERT/UPDATE/DELETE. These do not have enough output to overflow the buffer size. However, when these statements are executed in the middle of a REPEATABLE READ transaction (e.g. BEGIN ISOLATION LEVEL REPEATABLE READ; ... INSERT ... COMMIT;), a read restart error cannot be retried internally by YugabyteDB. The onus is on the application to ROLLBACK and retry the transaction. diff --git a/docs/content/stable/architecture/transactions/read-restart-error.md b/docs/content/stable/architecture/transactions/read-restart-error.md index 60b052e68282..d4c31b204e7e 100644 --- a/docs/content/stable/architecture/transactions/read-restart-error.md +++ b/docs/content/stable/architecture/transactions/read-restart-error.md @@ -32,6 +32,35 @@ A detailed scenario that explains how clock skew can result in the above mention * It should return the data even if the client issued the read from a different node after writing the data, because the following guarantee needs to be maintained: the database should always return data that was committed in the past (past refers to the user-perceived past, and not based on machine clocks). - * It should not return the data if the write is performed in the future (that is, after the read point had been chosen) **and** had a write timestamp later than the read point. Because if that is allowed, everything written in future would be trivially visible to the read. Note that the latter condition is important because it is okay to return data that was written after the read point was picked, if the write timestamp was earlier than the read point (this doesn't break and consistency or isolation guarantees). + * It should not return the data if the write is performed in the future (that is, after the read point had been chosen) **and** had a write timestamp later than the read point. Because if that is allowed, everything written in future would be trivially visible to the read. Note that the latter condition is important because it is okay to return data that was written after the read point was picked, if the write timestamp was earlier than the read point (this doesn't break any consistency or isolation guarantees). * If node `N2` finds writes in the range `(T1, T1+max_clock_skew]`, to avoid breaking the strong guarantee that a reader should always be able to read what was committed earlier, and to avoid reading data with a later write timestamp which was also actually written after the read had been issued, node `N2` raises a `Read restart` error. + +## Troubleshooting + +You can handle and mitigate read restart errors using the following techniques: + +- Implement retry logic in the application. Application retries can help mitigate read restart errors. Moreover, a statement or a transaction may fail in other ways such as transaction conflicts or infrastructure failures. Therefore, a retry mechanism is strongly recommended for a cloud-native, distributed database such as YugabyteDB. +- Use SERIALIZABLE READ ONLY DEFERRABLE mode whenever possible. Read restart errors usually occur when the query is a SELECT statement with a large output footprint and there are concurrent writes that satisfy the SELECT statement. + + Using DEFERRABLE will avoid a read restart error altogether. However, the tradeoff is that the statement waits out the maximum permissible clock skew before reading the data (which is max_clock_skew_usec that has a default of 500ms). This is not an issue for large SELECT statements running in the background because latency is not a priority. + + Examples: + + Set transaction properties at the session level. + ```sql + SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; + SELECT * FROM large_table; + ``` + + Enclose the offending query within a transaction block. + ```sql + BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; + SELECT * FROM large_table; + COMMIT; + ``` +- Using read only, deferrable transactions is not always feasible, either because the query is not read only, or the query is part of a read-write transaction, or because an additional 500ms of latency is not acceptable. In these cases, try increasing the value of `ysql_output_buffer_size`. + + This will enable YugabyteDB to retry the query internally on behalf of the user. As long as the output of a statement hasn't crossed ysql_output_buffer_size to result in flushing partial data to the external client, the YSQL query layer retries read restart errors for all statements in a Read Committed transaction block, for the first statement in a Repeatable Read transaction block, and for any standalone statement outside a transaction block. As a tradeoff, increasing the buffer size also increases the memory consumed by the YSQL backend processes, resulting in a higher risk of out-of-memory errors. + + Be aware that increasing `ysql_output_buffer_size` is not a silver bullet. For example, the COPY command can still raise a read restart error even though the command has a one line output. Increasing `ysql_output_buffer_size` is not useful in this scenario. The application must retry the COPY command instead. Another example is DMLs such as INSERT/UPDATE/DELETE. These do not have enough output to overflow the buffer size. However, when these statements are executed in the middle of a REPEATABLE READ transaction (e.g. BEGIN ISOLATION LEVEL REPEATABLE READ; ... INSERT ... COMMIT;), a read restart error cannot be retried internally by YugabyteDB. The onus is on the application to ROLLBACK and retry the transaction. From 1b9be2e0c11528b615f46c81e4bb54c89fe6d8aa Mon Sep 17 00:00:00 2001 From: Daniel Shubin Date: Tue, 16 Jul 2024 17:40:46 +0000 Subject: [PATCH 147/154] [PLAT-12733] Kubernetes overrides in v2 api Summary: Implemented kubernetes overrides v2 api Test Plan: unit tests Reviewers: sneelakantan, #yba-api-review Reviewed By: sneelakantan, #yba-api-review Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D36636 --- .../controllers/UniverseApiControllerImp.java | 31 ++++++---- .../UniverseUpgradesManagementHandler.java | 58 +++++++++++-------- .../UniverseDefinitionTaskParamsMapper.java | 10 ++++ ...seEditKubernetesOverridesParamsMapper.java | 19 ++++++ .../UniverseKubernetesOverridesReq.yaml | 5 ++ .../components/schemas/ClusterNodeSpec.yaml | 2 +- .../UniverseEditKubernetesOverrides.yaml | 19 ++++++ .../main/resources/openapi/paths/_index.yaml | 58 +++++++++++++++++++ .../resources/openapi/paths/universe.yaml | 58 +++++++++++++++++++ .../v2/UniverseApiControllerUpgradeTest.java | 29 +++++++++- 10 files changed, 249 insertions(+), 40 deletions(-) create mode 100644 managed/src/main/java/api/v2/mappers/UniverseEditKubernetesOverridesParamsMapper.java create mode 100644 managed/src/main/resources/openapi/components/requestBodies/UniverseKubernetesOverridesReq.yaml create mode 100644 managed/src/main/resources/openapi/components/schemas/UniverseEditKubernetesOverrides.yaml diff --git a/managed/src/main/java/api/v2/controllers/UniverseApiControllerImp.java b/managed/src/main/java/api/v2/controllers/UniverseApiControllerImp.java index eeacfa4f1392..2502809742c8 100644 --- a/managed/src/main/java/api/v2/controllers/UniverseApiControllerImp.java +++ b/managed/src/main/java/api/v2/controllers/UniverseApiControllerImp.java @@ -10,6 +10,7 @@ import api.v2.models.UniverseDeleteSpec; import api.v2.models.UniverseEditEncryptionInTransit; import api.v2.models.UniverseEditGFlags; +import api.v2.models.UniverseEditKubernetesOverrides; import api.v2.models.UniverseEditSpec; import api.v2.models.UniverseRestart; import api.v2.models.UniverseRollbackUpgradeReq; @@ -64,7 +65,7 @@ public YBATask deleteCluster( public YBATask editGFlags( Request request, UUID cUUID, UUID uniUUID, UniverseEditGFlags universeEditGFlags) throws Exception { - return universeUpgradeHandler.editGFlags(request, cUUID, uniUUID, universeEditGFlags); + return universeUpgradeHandler.editGFlags(cUUID, uniUUID, universeEditGFlags); } @Override @@ -78,66 +79,72 @@ public YBATask deleteUniverse( public YBATask startSoftwareUpgrade( Request request, UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeStart uniUpgrade) throws Exception { - return universeUpgradeHandler.startSoftwareUpgrade(request, cUUID, uniUUID, uniUpgrade); + return universeUpgradeHandler.startSoftwareUpgrade(cUUID, uniUUID, uniUpgrade); } @Override public YBATask finalizeSoftwareUpgrade( Request request, UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeFinalize finalizeInfo) throws Exception { - return universeUpgradeHandler.finalizeSoftwareUpgrade(request, cUUID, uniUUID, finalizeInfo); + return universeUpgradeHandler.finalizeSoftwareUpgrade(cUUID, uniUUID, finalizeInfo); } @Override public UniverseSoftwareUpgradeFinalizeInfo getFinalizeSoftwareUpgradeInfo( Request request, UUID cUUID, UUID uniUUID) throws Exception { - return universeUpgradeHandler.getSoftwareUpgradeFinalizeInfo(request, cUUID, uniUUID); + return universeUpgradeHandler.getSoftwareUpgradeFinalizeInfo(cUUID, uniUUID); } @Override public YBATask startThirdPartySoftwareUpgrade( Request request, UUID cUUID, UUID uniUUID, UniverseThirdPartySoftwareUpgradeStart uniUpgrade) throws Exception { - return universeUpgradeHandler.startThirdPartySoftwareUpgrade( - request, cUUID, uniUUID, uniUpgrade); + return universeUpgradeHandler.startThirdPartySoftwareUpgrade(cUUID, uniUUID, uniUpgrade); } @Override public YBATask rollbackSoftwareUpgrade( Request request, UUID cUUID, UUID uniUUID, UniverseRollbackUpgradeReq req) throws Exception { - return universeUpgradeHandler.rollbackSoftwareUpgrade(request, cUUID, uniUUID, req); + return universeUpgradeHandler.rollbackSoftwareUpgrade(cUUID, uniUUID, req); } @Override public UniverseSoftwareUpgradePrecheckResp precheckSoftwareUpgrade( Request request, UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradePrecheckReq req) throws Exception { - return universeUpgradeHandler.precheckSoftwareUpgrade(request, cUUID, uniUUID, req); + return universeUpgradeHandler.precheckSoftwareUpgrade(cUUID, uniUUID, req); } @Override public YBATask restartUniverse( Request request, UUID cUUID, UUID uniUUID, UniverseRestart uniUpgrade) throws Exception { - return universeUpgradeHandler.restartUniverse(request, cUUID, uniUUID, uniUpgrade); + return universeUpgradeHandler.restartUniverse(cUUID, uniUUID, uniUpgrade); } @Override public YBATask systemdEnable( Request request, UUID cUUID, UUID uniUUID, UniverseSystemdEnableStart systemd) throws Exception { - return universeUpgradeHandler.systemdEnable(request, cUUID, uniUUID, systemd); + return universeUpgradeHandler.systemdEnable(cUUID, uniUUID, systemd); } @Override public YBATask encryptionInTransitToggle( Request request, UUID cUUID, UUID uniUUID, UniverseEditEncryptionInTransit spec) throws Exception { - return universeUpgradeHandler.tlsToggle(request, cUUID, uniUUID, spec); + return universeUpgradeHandler.tlsToggle(cUUID, uniUUID, spec); } @Override public YBATask encryptionInTransitCertRotate( Request request, UUID cUUID, UUID uniUUID, UniverseCertRotateSpec spec) throws Exception { - return universeUpgradeHandler.certRotate(request, cUUID, uniUUID, spec); + return universeUpgradeHandler.certRotate(cUUID, uniUUID, spec); + } + + @Override + public YBATask editKubernetesOverrides( + Request request, UUID cUUID, UUID uniUUID, UniverseEditKubernetesOverrides spec) + throws Exception { + return universeUpgradeHandler.editKubernetesOverrides(cUUID, uniUUID, spec); } } diff --git a/managed/src/main/java/api/v2/handlers/UniverseUpgradesManagementHandler.java b/managed/src/main/java/api/v2/handlers/UniverseUpgradesManagementHandler.java index b1c5884640f3..1b0c6121bf69 100644 --- a/managed/src/main/java/api/v2/handlers/UniverseUpgradesManagementHandler.java +++ b/managed/src/main/java/api/v2/handlers/UniverseUpgradesManagementHandler.java @@ -6,6 +6,7 @@ import api.v2.mappers.UniverseCertsRotateParamsMapper; import api.v2.mappers.UniverseDefinitionTaskParamsMapper; import api.v2.mappers.UniverseEditGFlagsMapper; +import api.v2.mappers.UniverseEditKubernetesOverridesParamsMapper; import api.v2.mappers.UniverseRestartParamsMapper; import api.v2.mappers.UniverseRollbackUpgradeMapper; import api.v2.mappers.UniverseSoftwareFinalizeMapper; @@ -18,6 +19,7 @@ import api.v2.models.UniverseCertRotateSpec; import api.v2.models.UniverseEditEncryptionInTransit; import api.v2.models.UniverseEditGFlags; +import api.v2.models.UniverseEditKubernetesOverrides; import api.v2.models.UniverseRestart; import api.v2.models.UniverseRollbackUpgradeReq; import api.v2.models.UniverseSoftwareUpgradeFinalize; @@ -42,6 +44,7 @@ import com.yugabyte.yw.forms.CertsRotateParams; import com.yugabyte.yw.forms.FinalizeUpgradeParams; import com.yugabyte.yw.forms.GFlagsUpgradeParams; +import com.yugabyte.yw.forms.KubernetesOverridesUpgradeParams; import com.yugabyte.yw.forms.RestartTaskParams; import com.yugabyte.yw.forms.RollbackUpgradeParams; import com.yugabyte.yw.forms.SoftwareUpgradeParams; @@ -57,7 +60,6 @@ import com.yugabyte.yw.models.extended.SoftwareUpgradeInfoResponse; import java.util.UUID; import lombok.extern.slf4j.Slf4j; -import play.mvc.Http; @Singleton @Slf4j @@ -66,8 +68,7 @@ public class UniverseUpgradesManagementHandler extends ApiControllerUtils { @Inject public Commissioner commissioner; @Inject private RuntimeConfGetter confGetter; - public YBATask editGFlags( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseEditGFlags editGFlags) + public YBATask editGFlags(UUID cUUID, UUID uniUUID, UniverseEditGFlags editGFlags) throws JsonProcessingException { log.info("Starting v2 edit GFlags with {}", editGFlags); @@ -96,7 +97,7 @@ public YBATask editGFlags( } public YBATask startSoftwareUpgrade( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeStart upgradeStart) + UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeStart upgradeStart) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -122,7 +123,7 @@ public YBATask startSoftwareUpgrade( } public YBATask finalizeSoftwareUpgrade( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeFinalize upgradeStart) + UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradeFinalize upgradeStart) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -141,7 +142,7 @@ public YBATask finalizeSoftwareUpgrade( } public UniverseSoftwareUpgradeFinalizeInfo getSoftwareUpgradeFinalizeInfo( - Http.Request request, UUID cUUID, UUID uniUUID) { + UUID cUUID, UUID uniUUID) { Customer customer = Customer.getOrBadRequest(cUUID); Universe.getOrBadRequest(uniUUID, customer); @@ -153,10 +154,7 @@ public UniverseSoftwareUpgradeFinalizeInfo getSoftwareUpgradeFinalizeInfo( } public YBATask startThirdPartySoftwareUpgrade( - Http.Request request, - UUID cUUID, - UUID uniUUID, - UniverseThirdPartySoftwareUpgradeStart upgradeStart) + UUID cUUID, UUID uniUUID, UniverseThirdPartySoftwareUpgradeStart upgradeStart) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -176,8 +174,7 @@ public YBATask startThirdPartySoftwareUpgrade( return ybaTask; } - public YBATask rollbackSoftwareUpgrade( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseRollbackUpgradeReq req) + public YBATask rollbackSoftwareUpgrade(UUID cUUID, UUID uniUUID, UniverseRollbackUpgradeReq req) throws Exception { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -195,11 +192,7 @@ public YBATask rollbackSoftwareUpgrade( } public UniverseSoftwareUpgradePrecheckResp precheckSoftwareUpgrade( - Http.Request request, - UUID cUUID, - UUID uniUUID, - UniverseSoftwareUpgradePrecheckReq precheckReq) - throws Exception { + UUID cUUID, UUID uniUUID, UniverseSoftwareUpgradePrecheckReq precheckReq) throws Exception { if (confGetter.getGlobalConf(GlobalConfKeys.enableReleasesRedesign)) { Release.getByVersionOrBadRequest(precheckReq.getYbSoftwareVersion()); } @@ -210,8 +203,7 @@ public UniverseSoftwareUpgradePrecheckResp precheckSoftwareUpgrade( v1Resp); } - public YBATask restartUniverse( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseRestart uniRestart) + public YBATask restartUniverse(UUID cUUID, UUID uniUUID, UniverseRestart uniRestart) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -250,8 +242,7 @@ public YBATask restartUniverse( return ybaTask; } - public YBATask systemdEnable( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseSystemdEnableStart systemd) + public YBATask systemdEnable(UUID cUUID, UUID uniUUID, UniverseSystemdEnableStart systemd) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); Universe universe = Universe.getOrBadRequest(uniUUID, customer); @@ -271,8 +262,7 @@ public YBATask systemdEnable( return ybaTask; } - public YBATask tlsToggle( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseEditEncryptionInTransit spec) + public YBATask tlsToggle(UUID cUUID, UUID uniUUID, UniverseEditEncryptionInTransit spec) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); @@ -289,8 +279,7 @@ public YBATask tlsToggle( return ybaTask; } - public YBATask certRotate( - Http.Request request, UUID cUUID, UUID uniUUID, UniverseCertRotateSpec spec) + public YBATask certRotate(UUID cUUID, UUID uniUUID, UniverseCertRotateSpec spec) throws JsonProcessingException { Customer customer = Customer.getOrBadRequest(cUUID); @@ -306,4 +295,23 @@ public YBATask certRotate( log.info("Started cert rotate task {}", mapper.writeValueAsString(ybaTask)); return ybaTask; } + + public YBATask editKubernetesOverrides( + UUID cUUID, UUID uniUUID, UniverseEditKubernetesOverrides spec) + throws JsonProcessingException { + Customer customer = Customer.getOrBadRequest(cUUID); + Universe universe = Universe.getOrBadRequest(uniUUID, customer); + + KubernetesOverridesUpgradeParams v1Params = + UniverseDefinitionTaskParamsMapper.INSTANCE.toKubernetesOverridesUpgradeParams( + universe.getUniverseDetails()); + v1Params = + UniverseEditKubernetesOverridesParamsMapper.INSTANCE.copyToV1KubernetesOverridesParams( + spec, v1Params); + + UUID taskUUID = v1Handler.upgradeKubernetesOverrides(v1Params, customer, universe); + YBATask ybaTask = new YBATask().taskUuid(taskUUID).resourceUuid(uniUUID); + log.info("Started kubernetes overrides upgrade task {}", mapper.writeValueAsString(ybaTask)); + return ybaTask; + } } diff --git a/managed/src/main/java/api/v2/mappers/UniverseDefinitionTaskParamsMapper.java b/managed/src/main/java/api/v2/mappers/UniverseDefinitionTaskParamsMapper.java index 247f3ff6ca70..9924a632b815 100644 --- a/managed/src/main/java/api/v2/mappers/UniverseDefinitionTaskParamsMapper.java +++ b/managed/src/main/java/api/v2/mappers/UniverseDefinitionTaskParamsMapper.java @@ -19,6 +19,7 @@ import com.yugabyte.yw.forms.FinalizeUpgradeParams; import com.yugabyte.yw.forms.GFlagsUpgradeParams; import com.yugabyte.yw.forms.KubernetesGFlagsUpgradeParams; +import com.yugabyte.yw.forms.KubernetesOverridesUpgradeParams; import com.yugabyte.yw.forms.RestartTaskParams; import com.yugabyte.yw.forms.RollbackUpgradeParams; import com.yugabyte.yw.forms.SoftwareUpgradeParams; @@ -154,6 +155,15 @@ public ThirdpartySoftwareUpgradeParams toThirdpartySoftwareUpgradeParams( @Mapping(target = "nonPrimaryClusters", ignore = true) public CertsRotateParams toCertsRotateParams(UniverseDefinitionTaskParams source); + @Mapping(target = "existingLBs", ignore = true) + @Mapping(target = "primaryCluster", ignore = true) + @Mapping(target = "TServers", ignore = true) + @Mapping(target = "readOnlyClusters", ignore = true) + @Mapping(target = "addOnClusters", ignore = true) + @Mapping(target = "nonPrimaryClusters", ignore = true) + public KubernetesOverridesUpgradeParams toKubernetesOverridesUpgradeParams( + UniverseDefinitionTaskParams source); + @Mapping(target = "spec", source = ".") UniverseCreateSpec toV2UniverseCreateSpec(UniverseDefinitionTaskParams v1UniverseTaskParams); diff --git a/managed/src/main/java/api/v2/mappers/UniverseEditKubernetesOverridesParamsMapper.java b/managed/src/main/java/api/v2/mappers/UniverseEditKubernetesOverridesParamsMapper.java new file mode 100644 index 000000000000..4dbcff77b135 --- /dev/null +++ b/managed/src/main/java/api/v2/mappers/UniverseEditKubernetesOverridesParamsMapper.java @@ -0,0 +1,19 @@ +package api.v2.mappers; + +import api.v2.models.UniverseEditKubernetesOverrides; +import com.yugabyte.yw.forms.KubernetesOverridesUpgradeParams; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; +import org.mapstruct.factory.Mappers; + +@Mapper(config = CentralConfig.class) +public interface UniverseEditKubernetesOverridesParamsMapper { + UniverseEditKubernetesOverridesParamsMapper INSTANCE = + Mappers.getMapper(UniverseEditKubernetesOverridesParamsMapper.class); + + @Mapping(source = "overrides", target = "universeOverrides") + KubernetesOverridesUpgradeParams copyToV1KubernetesOverridesParams( + UniverseEditKubernetesOverrides source, + @MappingTarget KubernetesOverridesUpgradeParams target); +} diff --git a/managed/src/main/resources/openapi/components/requestBodies/UniverseKubernetesOverridesReq.yaml b/managed/src/main/resources/openapi/components/requestBodies/UniverseKubernetesOverridesReq.yaml new file mode 100644 index 000000000000..4bd04d84f00e --- /dev/null +++ b/managed/src/main/resources/openapi/components/requestBodies/UniverseKubernetesOverridesReq.yaml @@ -0,0 +1,5 @@ +required: true +content: + application/json: + schema: + $ref: "../schemas/UniverseEditKubernetesOverrides.yaml" diff --git a/managed/src/main/resources/openapi/components/schemas/ClusterNodeSpec.yaml b/managed/src/main/resources/openapi/components/schemas/ClusterNodeSpec.yaml index 377542b54f7b..a17ff0c7703b 100644 --- a/managed/src/main/resources/openapi/components/schemas/ClusterNodeSpec.yaml +++ b/managed/src/main/resources/openapi/components/schemas/ClusterNodeSpec.yaml @@ -11,6 +11,6 @@ allOf: description: Used only for a k8s Universe. Required for k8s Universe if instance_type is not specified. Sets custom cpu and memory requests/limits for tserver pods of a cluster. $ref: "./K8SNodeResourceSpec.yaml" az_node_spec: - description: Granular node settings overridden per Availability Zone idetified by AZ uuid. + description: Granular node settings overridden per Availability Zone identified by AZ uuid. additionalProperties: $ref: "./AvailabilityZoneNodeSpec.yaml" diff --git a/managed/src/main/resources/openapi/components/schemas/UniverseEditKubernetesOverrides.yaml b/managed/src/main/resources/openapi/components/schemas/UniverseEditKubernetesOverrides.yaml new file mode 100644 index 000000000000..671deadf289a --- /dev/null +++ b/managed/src/main/resources/openapi/components/schemas/UniverseEditKubernetesOverrides.yaml @@ -0,0 +1,19 @@ +title: UniverseEditKubernetesOverrides +description: | + UniverseEditKubernetesOverrides + + Update all kubernetes overrides on the universe. Part of UniverseKubernetesOverridesReq +type: object +properties: + overrides: + description: Global kubernetes overrides to apply across the entire universe. + type: string + example: |- + tserver: + podLabels: + env: test + az_overrides: + description: Granular kubernetes overrides per Availability Zone identified by AZ uuid. + example: 'az_uuid: "tserver:\n podLabels:\n env: test"' + additionalProperties: + type: string diff --git a/managed/src/main/resources/openapi/paths/_index.yaml b/managed/src/main/resources/openapi/paths/_index.yaml index 0dcf4f7351c3..2f175501ee24 100644 --- a/managed/src/main/resources/openapi/paths/_index.yaml +++ b/managed/src/main/resources/openapi/paths/_index.yaml @@ -938,3 +938,61 @@ checkOnlyPermission: false x-yba-api-since: 2024.2.0.0 x-yba-api-visibility: preview +'/customers/{cUUID}/universes/{uniUUID}/kubernetes-overrides': + parameters: + - name: cUUID + in: path + description: Customer UUID + schema: + type: string + format: uuid + explode: false + style: simple + required: true + - name: uniUUID + in: path + description: Universe UUID + schema: + type: string + format: uuid + explode: false + style: simple + required: true + post: + operationId: editKubernetesOverrides + summary: Edit Kubernetes Helm Overrides + description: | + Update the kubernetes helm override values. This can be used to add custom settings to + kubernetes resources managed by YugabyteDB Anywhere. These override values can apply globally + to a universe or per AZ. + + See https://github.com/yugabyte/charts/blob/master/stable/yugabyte/values.yaml for possible + override options. + tags: + - Universe + requestBody: + $ref: "../components/requestBodies/UniverseKubernetesOverridesReq.yaml" + responses: + '202': + $ref: "../components/responses/YBATaskResp.yaml" + '400': + description: Invalid input + '500': + description: Server error + security: + - apiKeyAuth: [] + x-yba-api-audit: + auditTargetType: Universe + auditTargetId: uniUUID.toString() + auditActionType: UpgradeKubernetesOverrides + taskUuid: obj.getTaskUuid() + x-yba-api-authz: + - requiredPermission: + resourceType: universe + action: UPDATE + resourceLocation: + path: universes + sourceType: endpoint + checkOnlyPermission: false + x-yba-api-since: 2024.2.0.0 + x-yba-api-visibility: preview diff --git a/managed/src/main/resources/openapi/paths/universe.yaml b/managed/src/main/resources/openapi/paths/universe.yaml index 9693e0056b78..9d0c7ff5745d 100644 --- a/managed/src/main/resources/openapi/paths/universe.yaml +++ b/managed/src/main/resources/openapi/paths/universe.yaml @@ -821,3 +821,61 @@ checkOnlyPermission: false x-yba-api-since: 2024.2.0.0 x-yba-api-visibility: preview +'/customers/{cUUID}/universes/{uniUUID}/kubernetes-overrides': + parameters: + - name: cUUID + in: path + description: Customer UUID + schema: + type: string + format: uuid + explode: false + style: simple + required: true + - name: uniUUID + in: path + description: Universe UUID + schema: + type: string + format: uuid + explode: false + style: simple + required: true + post: + operationId: editKubernetesOverrides + summary: Edit Kubernetes Helm Overrides + description: | + Update the kubernetes helm override values. This can be used to add custom settings to + kubernetes resources managed by YugabyteDB Anywhere. These override values can apply globally + to a universe or per AZ. + + See https://github.com/yugabyte/charts/blob/master/stable/yugabyte/values.yaml for possible + override options. + tags: + - Universe + requestBody: + $ref: "../components/requestBodies/UniverseKubernetesOverridesReq.yaml" + responses: + '202': + $ref: "../components/responses/YBATaskResp.yaml" + '400': + description: Invalid input + '500': + description: Server error + security: + - apiKeyAuth: [] + x-yba-api-audit: + auditTargetType: Universe + auditTargetId: uniUUID.toString() + auditActionType: UpgradeKubernetesOverrides + taskUuid: obj.getTaskUuid() + x-yba-api-authz: + - requiredPermission: + resourceType: universe + action: UPDATE + resourceLocation: + path: universes + sourceType: endpoint + checkOnlyPermission: false + x-yba-api-since: 2024.2.0.0 + x-yba-api-visibility: preview diff --git a/managed/src/test/java/com/yugabyte/yw/api/v2/UniverseApiControllerUpgradeTest.java b/managed/src/test/java/com/yugabyte/yw/api/v2/UniverseApiControllerUpgradeTest.java index 85eb73522fec..d52d3fb047c8 100644 --- a/managed/src/test/java/com/yugabyte/yw/api/v2/UniverseApiControllerUpgradeTest.java +++ b/managed/src/test/java/com/yugabyte/yw/api/v2/UniverseApiControllerUpgradeTest.java @@ -20,6 +20,7 @@ import com.yugabyte.yba.v2.client.api.UniverseApi; import com.yugabyte.yba.v2.client.models.UniverseCertRotateSpec; import com.yugabyte.yba.v2.client.models.UniverseEditEncryptionInTransit; +import com.yugabyte.yba.v2.client.models.UniverseEditKubernetesOverrides; import com.yugabyte.yba.v2.client.models.UniverseRollbackUpgradeReq; import com.yugabyte.yba.v2.client.models.UniverseSoftwareFinalizeImpactedXCluster; import com.yugabyte.yba.v2.client.models.UniverseSoftwareUpgradeFinalize; @@ -36,6 +37,7 @@ import com.yugabyte.yw.controllers.handlers.UpgradeUniverseHandler; import com.yugabyte.yw.forms.CertsRotateParams; import com.yugabyte.yw.forms.FinalizeUpgradeParams; +import com.yugabyte.yw.forms.KubernetesOverridesUpgradeParams; import com.yugabyte.yw.forms.RollbackUpgradeParams; import com.yugabyte.yw.forms.SoftwareUpgradeParams; import com.yugabyte.yw.forms.SystemdUpgradeParams; @@ -50,6 +52,8 @@ import com.yugabyte.yw.models.extended.FinalizeUpgradeInfoResponse; import com.yugabyte.yw.models.extended.SoftwareUpgradeInfoResponse; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import org.junit.Before; import org.junit.Test; @@ -379,11 +383,9 @@ public void testV2CertRotation() throws ApiException { .thenReturn(taskUUID); UniverseCertRotateSpec req = new UniverseCertRotateSpec(); req.setRollingUpgrade(true); - ; UUID clientCert = UUID.randomUUID(); UUID nodeCert = UUID.randomUUID(); req.setRootCa(nodeCert); - ; req.setClientRootCa(clientCert); YBATask resp = apiClient.encryptionInTransitCertRotate( @@ -397,4 +399,27 @@ public void testV2CertRotation() throws ApiException { assertEquals(nodeCert, params.rootCA); assertFalse(params.rootAndClientRootCASame); } + + @Test + public void testV2KubernetesOverrides() throws ApiException { + UUID taskUUID = UUID.randomUUID(); + when(mockUpgradeUniverseHandler.upgradeKubernetesOverrides(any(), eq(customer), eq(universe))) + .thenReturn(taskUUID); + UniverseEditKubernetesOverrides req = new UniverseEditKubernetesOverrides(); + req.setOverrides("my_overrides"); + Map azOverrides = new HashMap(); + azOverrides.put("az1", "az1_overrides"); + req.setAzOverrides(azOverrides); + YBATask resp = + apiClient.editKubernetesOverrides(customer.getUuid(), universe.getUniverseUUID(), req); + ArgumentCaptor captor = + ArgumentCaptor.forClass(KubernetesOverridesUpgradeParams.class); + verify(mockUpgradeUniverseHandler) + .upgradeKubernetesOverrides(captor.capture(), eq(customer), eq(universe)); + KubernetesOverridesUpgradeParams params = captor.getValue(); + assertEquals(taskUUID, resp.getTaskUuid()); + assertEquals("my_overrides", params.universeOverrides); + assertTrue(params.azOverrides.containsKey("az1")); + assertEquals("az1_overrides", params.azOverrides.get("az1")); + } } From 50422f8347d686e7922d8d9803d841a3f9d8ef58 Mon Sep 17 00:00:00 2001 From: Oleg Loginov Date: Wed, 3 Jul 2024 21:00:03 +0300 Subject: [PATCH 148/154] [#23011] YSQL: Enable ALTER TABLE IF EXISTS t RENAME c1 TO c2 Summary: Enabled YSQL `ALTER TABLE IF EXISTS ... RENAME ... TO ...` syntax. In fact the needed internal functionality was already implemented in the functions: `renameatt` and `YBCRename`, but the command was disabled at the grammar level. The diff also adds several test-cases for the syntax: * `ALTER TABLE IF EXISTS ...` (new enabled functionality) * `ALTER TABLE ... RENAME COLUMN ...` * Plus minor changes for `ALTER TABLE ... RENAME ...` Jira: DB-11940 Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressFeature#testPgRegressFeature ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressTable#testPgRegressTable Reviewers: mihnea, fizaa, jason Reviewed By: jason Subscribers: jason, yql Differential Revision: https://phorge.dev.yugabyte.com/D36390 --- src/postgres/src/backend/parser/gram.y | 1 - .../expected/yb_feature_alter_table.out | 9 ++++++- .../regress/expected/yb_pg_alter_table.out | 27 +++++++++++++++++++ .../regress/sql/yb_feature_alter_table.sql | 8 +++++- .../test/regress/sql/yb_pg_alter_table.sql | 27 +++++++++++++++++++ 5 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/postgres/src/backend/parser/gram.y b/src/postgres/src/backend/parser/gram.y index 7bbcf3b26d88..e261bc8bea4b 100644 --- a/src/postgres/src/backend/parser/gram.y +++ b/src/postgres/src/backend/parser/gram.y @@ -9665,7 +9665,6 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name } | ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name { - parser_ybc_not_support(@1, "ALTER TABLE IF EXISTS"); RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_TABLE; diff --git a/src/postgres/src/test/regress/expected/yb_feature_alter_table.out b/src/postgres/src/test/regress/expected/yb_feature_alter_table.out index aa35ff61d9cd..ddc6103743c7 100644 --- a/src/postgres/src/test/regress/expected/yb_feature_alter_table.out +++ b/src/postgres/src/test/regress/expected/yb_feature_alter_table.out @@ -253,7 +253,14 @@ ERROR: constraint "checkb2" for table "atacc1" does not exist alter table atacc1 drop constraint if exists checkb3; delete from atacc1 where b = 5; -- test rename -alter table atacc1 rename b to e; +alter table atacc1 rename b to d; -- should fail: d already exists +ERROR: column "d" of relation "atacc1" already exists +alter table atacc1 rename b to f; +alter table atacc1 rename column f to e; +alter table if exists doesnt_exist_tab rename b to f; +NOTICE: relation "doesnt_exist_tab" does not exist, skipping +alter table if exists doesnt_exist_tab rename column f to e; +NOTICE: relation "doesnt_exist_tab" does not exist, skipping select * from atacc1; e | c | d ----+----+---- diff --git a/src/postgres/src/test/regress/expected/yb_pg_alter_table.out b/src/postgres/src/test/regress/expected/yb_pg_alter_table.out index c467d4fba7df..43fb4204d43b 100644 --- a/src/postgres/src/test/regress/expected/yb_pg_alter_table.out +++ b/src/postgres/src/test/regress/expected/yb_pg_alter_table.out @@ -292,6 +292,33 @@ Check constraints: DROP TABLE constraint_rename_cache; DROP TABLE like_constraint_rename_cache; +-- test inheritance +create table renameColumn (a int); +create table renameColumnChild (b int) inherits (renameColumn); +ERROR: INHERITS not supported yet +LINE 1: create table renameColumnChild (b int) inherits (renameColum... + ^ +HINT: See https://github.com/yugabyte/yugabyte-db/issues/1129. React with thumbs up to raise its priority +/* YB: uncomment when INHERITS is supported +create table renameColumnAnother (c int) inherits (renameColumnChild); + +-- these three should fail +alter table renameColumnChild rename column a to d; +alter table only renameColumnChild rename column a to d; +alter table only renameColumn rename column a to d; +*/ -- YB +-- these should work +alter table renameColumn rename column a to d; +/* YB: uncomment when INHERITS is supported +alter table renameColumnChild rename column b to a; +*/ -- YB +-- these should work +alter table if exists doesnt_exist_tab rename column a to d; +NOTICE: relation "doesnt_exist_tab" does not exist, skipping +alter table if exists doesnt_exist_tab rename column b to a; +NOTICE: relation "doesnt_exist_tab" does not exist, skipping +-- this should work +alter table renameColumn add column w int; -- -- lock levels -- diff --git a/src/postgres/src/test/regress/sql/yb_feature_alter_table.sql b/src/postgres/src/test/regress/sql/yb_feature_alter_table.sql index 171007cb953a..39937d28132f 100644 --- a/src/postgres/src/test/regress/sql/yb_feature_alter_table.sql +++ b/src/postgres/src/test/regress/sql/yb_feature_alter_table.sql @@ -144,7 +144,13 @@ alter table atacc1 drop constraint if exists checkb3; delete from atacc1 where b = 5; -- test rename -alter table atacc1 rename b to e; +alter table atacc1 rename b to d; -- should fail: d already exists +alter table atacc1 rename b to f; +alter table atacc1 rename column f to e; + +alter table if exists doesnt_exist_tab rename b to f; +alter table if exists doesnt_exist_tab rename column f to e; + select * from atacc1; -- try dropping all columns diff --git a/src/postgres/src/test/regress/sql/yb_pg_alter_table.sql b/src/postgres/src/test/regress/sql/yb_pg_alter_table.sql index 5e9c0e027b4c..5a952145fb4b 100644 --- a/src/postgres/src/test/regress/sql/yb_pg_alter_table.sql +++ b/src/postgres/src/test/regress/sql/yb_pg_alter_table.sql @@ -297,6 +297,33 @@ CREATE TABLE like_constraint_rename_cache DROP TABLE constraint_rename_cache; DROP TABLE like_constraint_rename_cache; +-- test inheritance + +create table renameColumn (a int); +create table renameColumnChild (b int) inherits (renameColumn); +/* YB: uncomment when INHERITS is supported +create table renameColumnAnother (c int) inherits (renameColumnChild); + +-- these three should fail +alter table renameColumnChild rename column a to d; +alter table only renameColumnChild rename column a to d; +alter table only renameColumn rename column a to d; +*/ -- YB + +-- these should work +alter table renameColumn rename column a to d; +/* YB: uncomment when INHERITS is supported +alter table renameColumnChild rename column b to a; +*/ -- YB + +-- these should work +alter table if exists doesnt_exist_tab rename column a to d; +alter table if exists doesnt_exist_tab rename column b to a; + +-- this should work +alter table renameColumn add column w int; + + -- -- lock levels -- From 7c55b954c906faff8b03dc92405fa0f836640927 Mon Sep 17 00:00:00 2001 From: Artem Mindrov Date: Mon, 22 Jul 2024 19:55:58 +0000 Subject: [PATCH 149/154] [PLAT-14073] DB scoped failover+repair Summary: Enable DB scoped failover + repair. Test Plan: Set up DB scoped DR between A and B. Do a failover, then repair back to A. Do another failover, then repair back to B. Log in to both universes, check replication status ``` Outbound Replication Group: baef4b9e-99dc-4fea-ab12-98b0b5c500a4_--DR-CONFIG-dr-config-kind-magenta-lobster-0 Namespace ID: 00004104000030008000000000000000 Namespace name: yugabyte Table Id Stream Id 00004104000030008000000000004003 c45e187412d94ca0ad44f308c0d879ff 00004104000030008000000000004000 f581e6143bdde293c04c0f83ad75dfcc ``` Use ysqlsh to check that table contents are the same on both source and target after repair. This diff also has fixes for DB scoped switchover that broke with the changes to support DB scoped bootstrapping, so repeat test plan https://phorge.dev.yugabyte.com/D35907 too. Reviewers: cwang, hzare, sanketh, spothuraju Reviewed By: cwang Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D36537 --- .../tasks/CreateXClusterConfig.java | 58 ++- .../yw/commissioner/tasks/EditDrConfig.java | 27 +- .../tasks/RestartXClusterConfig.java | 90 ++-- .../commissioner/tasks/UniverseTaskBase.java | 9 +- .../tasks/XClusterConfigTaskBase.java | 26 ++ .../xcluster/WaitForReplicationDrain.java | 5 +- .../yw/controllers/DrConfigController.java | 383 ++++++++++-------- .../controllers/XClusterConfigController.java | 27 ++ .../yw/forms/XClusterConfigTaskParams.java | 10 + .../controllers/DrConfigControllerTest.java | 227 ++++++++++- 10 files changed, 615 insertions(+), 247 deletions(-) diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/CreateXClusterConfig.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/CreateXClusterConfig.java index 99f278148bf6..5a5cc067815a 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/CreateXClusterConfig.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/CreateXClusterConfig.java @@ -20,6 +20,7 @@ import com.yugabyte.yw.forms.DrConfigCreateForm; import com.yugabyte.yw.forms.RestoreBackupParams; import com.yugabyte.yw.forms.XClusterConfigCreateFormData; +import com.yugabyte.yw.forms.XClusterConfigCreateFormData.BootstrapParams.BootstrapBackupParams; import com.yugabyte.yw.models.Backup; import com.yugabyte.yw.models.Customer; import com.yugabyte.yw.models.PitrConfig; @@ -86,10 +87,7 @@ protected boolean checkBootstrapRequired( } Duration xclusterWaitTimeout = - this.confGetter.getConfForScope(sourceUniverse, UniverseConfKeys.xclusterSetupAlterTimeout); - long sleepTimeMs; - int iterationNum = 0; - Duration currentElapsedTime; + confGetter.getConfForScope(sourceUniverse, UniverseConfKeys.xclusterSetupAlterTimeout); try (YBClient client = ybService.getClient( @@ -333,6 +331,15 @@ protected void addSubtasksToCreateXClusterConfig( } } + protected void addSubtasksToCreateXClusterConfig( + XClusterConfig xClusterConfig, + Set sourceDbIds, + @Nullable DrConfigCreateForm.PitrParams pitrParams, + boolean isForceBootstrap) { + addSubtasksToCreateXClusterConfig( + xClusterConfig, null, null, null, sourceDbIds, pitrParams, isForceBootstrap); + } + protected void addSubtasksToCreateXClusterConfig( XClusterConfig xClusterConfig, Set sourceDbIds, @@ -395,9 +402,8 @@ protected void addSubtasksForTablesNotNeedBootstrap( } // Set up PITRs for txn/db scoped xCluster. - if (xClusterConfig.getType() != (ConfigType.Basic)) { + if (xClusterConfig.getType() != ConfigType.Basic) { Set namespaces; - if (xClusterConfig.getType() == ConfigType.Db) { namespaces = getNamespaces(sourceUniverse, sourceDbIds); if (namespaces.size() != sourceDbIds.size()) { @@ -533,7 +539,12 @@ protected void addSubtasksForTablesNeedBootstrap( // For db scoped replication, we will skip backup/restore subtasks at runtime if bootstrapping // is not required. For non-db scoped replication, we always perform backup restore here. Predicate bootstrapRequiredPredicate = - (task) -> { + task -> { + if (xClusterConfig.isUsedForDr() + && xClusterConfig.getDrConfig().getFailoverXClusterConfig() != null) { + return false; + } + if (xClusterConfig.getType() == ConfigType.Db) { return checkBootstrapRequired(namespaceId, ybService, sourceUniverse, xClusterConfig); } @@ -598,13 +609,21 @@ protected void addSubtasksForTablesNeedBootstrap( sourceUniverse.isYbcEnabled() && targetUniverse.isYbcEnabled() && confGetter.getGlobalConf(GlobalConfKeys.enableYbcForXCluster); + + BootstrapBackupParams backupParams = null; + if (bootstrapParams == null) { + if (xClusterConfig.isUsedForDr()) { + backupParams = new BootstrapBackupParams(); + backupParams.storageConfigUUID = xClusterConfig.getDrConfig().getStorageConfigUuid(); + backupParams.parallelism = xClusterConfig.getDrConfig().getParallelism(); + } + } else { + backupParams = bootstrapParams.backupRequestParams; + } + BackupRequestParams backupRequestParams = getBackupRequestParams( - sourceUniverse, - bootstrapParams, - tablesInfoListNeedBootstrap, - namespaceName, - tableType); + sourceUniverse, backupParams, tablesInfoListNeedBootstrap, namespaceName, tableType); Backup backup = createAllBackupSubtasks( backupRequestParams, @@ -667,7 +686,8 @@ protected void addSubtasksForTablesNeedBootstrap( .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.RestoringBackup); } else if (tableType == CommonTypes.TableType.PGSQL_TABLE_TYPE) { // Delete hanging replication streams, otherwise deleting the database will fail. - createDeleteRemnantStreamsTask(targetUniverse.getUniverseUUID(), namespaceName); + createDeleteRemnantStreamsTask(targetUniverse.getUniverseUUID(), namespaceName) + .setShouldRunPredicate(bootstrapRequiredPredicate); // If the table type is YSQL, delete the database from the target universe before restore. createDeleteKeySpaceTask( namespaceName, CommonTypes.TableType.PGSQL_TABLE_TYPE, true /*ysqlForce*/) @@ -848,18 +868,18 @@ protected void addSubtasksForTablesNeedBootstrap( return dbToTablesInfoMapNeedBootstrap; } - static BackupRequestParams getBackupRequestParams( + private static BackupRequestParams getBackupRequestParams( Universe sourceUniverse, - XClusterConfigCreateFormData.BootstrapParams bootstrapParams, + BootstrapBackupParams backupParams, @Nullable List tablesInfoListNeedBootstrap, String namespaceName, CommonTypes.TableType tableType) { BackupRequestParams backupRequestParams; - if (bootstrapParams != null && bootstrapParams.backupRequestParams != null) { + if (backupParams != null) { backupRequestParams = new BackupRequestParams(); - backupRequestParams.storageConfigUUID = bootstrapParams.backupRequestParams.storageConfigUUID; - backupRequestParams.parallelism = bootstrapParams.backupRequestParams.parallelism; + backupRequestParams.storageConfigUUID = backupParams.storageConfigUUID; + backupRequestParams.parallelism = backupParams.parallelism; } else { // In case the user does not pass the backup parameters, use the default values. backupRequestParams = new BackupRequestParams(); @@ -869,7 +889,7 @@ static BackupRequestParams getBackupRequestParams( Backup.fetchLatestByState(backupRequestParams.customerUUID, Backup.BackupState.Completed); if (latestCompletedBackupOptional.isEmpty()) { throw new RuntimeException( - "bootstrapParams in XClusterConfigCreateFormData is null, and storageConfigUUID " + "backupParams in XClusterConfigCreateFormData is null, and storageConfigUUID " + "cannot be determined based on the latest successful backup"); } backupRequestParams.storageConfigUUID = diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/EditDrConfig.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/EditDrConfig.java index ef1f13079bdf..8781d5cbd30e 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/EditDrConfig.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/EditDrConfig.java @@ -160,17 +160,22 @@ protected void addSubtasksToUseNewXClusterConfig( createXClusterConfigSetStatusTask(newXClusterConfig, XClusterConfigStatusType.Updating); - createXClusterConfigSetStatusForTablesTask( - newXClusterConfig, - getTableIds(taskParams().getTableInfoList()), - XClusterTableConfig.Status.Updating); - - addSubtasksToCreateXClusterConfig( - newXClusterConfig, - taskParams().getTableInfoList(), - taskParams().getMainTableIndexTablesMap(), - taskParams().getSourceTableIdsWithNoTableOnTargetUniverse(), - taskParams().getPitrParams()); + if (newXClusterConfig.getType() == XClusterConfig.ConfigType.Db) { + addSubtasksToCreateXClusterConfig( + newXClusterConfig, taskParams().getDbs(), taskParams().getPitrParams()); + } else { + createXClusterConfigSetStatusForTablesTask( + newXClusterConfig, + getTableIds(taskParams().getTableInfoList()), + XClusterTableConfig.Status.Updating); + + addSubtasksToCreateXClusterConfig( + newXClusterConfig, + taskParams().getTableInfoList(), + taskParams().getMainTableIndexTablesMap(), + taskParams().getSourceTableIdsWithNoTableOnTargetUniverse(), + taskParams().getPitrParams()); + } createXClusterConfigSetStatusTask(newXClusterConfig, XClusterConfigStatusType.Running) .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.ConfigureUniverse); diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/RestartXClusterConfig.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/RestartXClusterConfig.java index 71aac5fc5c65..5204bb216126 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/RestartXClusterConfig.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/RestartXClusterConfig.java @@ -10,11 +10,14 @@ import com.yugabyte.yw.models.Restore; import com.yugabyte.yw.models.Universe; import com.yugabyte.yw.models.XClusterConfig; +import com.yugabyte.yw.models.XClusterConfig.ConfigType; import com.yugabyte.yw.models.XClusterConfig.XClusterConfigStatusType; import com.yugabyte.yw.models.XClusterTableConfig; +import java.util.List; import java.util.Set; import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; +import org.yb.master.MasterDdlOuterClass; @Slf4j public class RestartXClusterConfig extends EditXClusterConfig { @@ -44,32 +47,42 @@ public void run() { createCheckXUniverseAutoFlag(sourceUniverse, targetUniverse) .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.PreflightChecks); - // Set table type for old xCluster configs. - xClusterConfig.updateTableType(taskParams().getTableInfoList()); + // TODO full DB scoped restart support + List tableInfoList = + taskParams().getTableInfoList(); + Set tableIds = getTableIds(tableInfoList); - // Do not skip bootstrapping for the following tables. It will check if it is required. - if (taskParams().getBootstrapParams() != null) { - xClusterConfig.updateNeedBootstrapForTables( - taskParams().getBootstrapParams().tables, true /* needBootstrap */); - } + boolean isRestartWholeConfig; + if (xClusterConfig.getType() != ConfigType.Db) { + // Set table type for old xCluster configs. + xClusterConfig.updateTableType(tableInfoList); - createXClusterConfigSetStatusTask( - xClusterConfig, XClusterConfig.XClusterConfigStatusType.Updating) - .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.DeleteXClusterReplication); + // Do not skip bootstrapping for the following tables. It will check if it is required. + if (taskParams().getBootstrapParams() != null) { + xClusterConfig.updateNeedBootstrapForTables( + taskParams().getBootstrapParams().tables, true /* needBootstrap */); + } - Set tableIds = getTableIds(taskParams().getTableInfoList()); + createXClusterConfigSetStatusTask( + xClusterConfig, XClusterConfig.XClusterConfigStatusType.Updating) + .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.DeleteXClusterReplication); + + // A replication group with no tables in it cannot exist in YBDB. If all the tables + // must be removed from the replication group, remove the replication group. + isRestartWholeConfig = + xClusterConfig.getTableIdsWithReplicationSetup(tableIds, true /* done */).size() + >= xClusterConfig.getTableIdsWithReplicationSetup().size(); + } else { + isRestartWholeConfig = + taskParams().getDbs().size() == xClusterConfig.getNamespaces().size(); + } - // A replication group with no tables in it cannot exist in YBDB. If all the tables must be - // removed from the replication group, remove the replication group. - boolean isRestartWholeConfig = - xClusterConfig.getTableIdsWithReplicationSetup(tableIds, true /* done */).size() - >= xClusterConfig.getTableIdsWithReplicationSetup().size(); log.info("isRestartWholeConfig is {}", isRestartWholeConfig); if (isRestartWholeConfig) { - createXClusterConfigSetStatusForTablesTask( - xClusterConfig, - getTableIds(taskParams().getTableInfoList()), - XClusterTableConfig.Status.Updating); + if (xClusterConfig.getType() != ConfigType.Db) { + createXClusterConfigSetStatusForTablesTask( + xClusterConfig, getTableIds(tableInfoList), XClusterTableConfig.Status.Updating); + } // Delete the replication group. createDeleteXClusterConfigSubtasks( @@ -91,19 +104,25 @@ public void run() { createXClusterConfigSetStatusTask( xClusterConfig, XClusterConfig.XClusterConfigStatusType.Updating); - createXClusterConfigSetStatusForTablesTask( - xClusterConfig, - getTableIds(taskParams().getTableInfoList()), - XClusterTableConfig.Status.Updating); - - addSubtasksToCreateXClusterConfig( - xClusterConfig, - taskParams().getTableInfoList(), - taskParams().getMainTableIndexTablesMap(), - taskParams().getSourceTableIdsWithNoTableOnTargetUniverse(), - null, - taskParams().getPitrParams(), - taskParams().isForceBootstrap()); + if (xClusterConfig.getType() == ConfigType.Db) { + addSubtasksToCreateXClusterConfig( + xClusterConfig, + taskParams().getDbs(), + taskParams().getPitrParams(), + taskParams().isForceBootstrap()); + } else { + createXClusterConfigSetStatusForTablesTask( + xClusterConfig, getTableIds(tableInfoList), XClusterTableConfig.Status.Updating); + + addSubtasksToCreateXClusterConfig( + xClusterConfig, + tableInfoList, + taskParams().getMainTableIndexTablesMap(), + taskParams().getSourceTableIdsWithNoTableOnTargetUniverse(), + null, + taskParams().getPitrParams(), + taskParams().isForceBootstrap()); + } } else { createXClusterConfigSetStatusForTablesTask( xClusterConfig, tableIds, XClusterTableConfig.Status.Updating); @@ -115,10 +134,7 @@ public void run() { xClusterConfig, tableIds, XClusterTableConfig.Status.Updating); addSubtasksToAddTablesToXClusterConfig( - xClusterConfig, - taskParams().getTableInfoList(), - taskParams().getMainTableIndexTablesMap(), - tableIds); + xClusterConfig, tableInfoList, taskParams().getMainTableIndexTablesMap(), tableIds); } createXClusterConfigSetStatusTask( diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/UniverseTaskBase.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/UniverseTaskBase.java index 601f4ef749ce..817eac76503b 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/UniverseTaskBase.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/UniverseTaskBase.java @@ -5485,9 +5485,12 @@ protected void createDeleteXClusterConfigSubtasks( createDeleteReplicationTask(xClusterConfig, forceDelete) .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.DeleteXClusterReplication); if (xClusterConfig.getType() == ConfigType.Db) { - // TODO: add forceDelete. - createDeleteReplicationOnSourceTask(xClusterConfig) - .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.DeleteXClusterReplication); + // If it's in the middle of a repair, there's no replication on source. + if (!(xClusterConfig.isUsedForDr() && xClusterConfig.getDrConfig().isHalted())) { + // TODO: add forceDelete. + createDeleteReplicationOnSourceTask(xClusterConfig) + .setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.DeleteXClusterReplication); + } } else { // Delete bootstrap IDs created by bootstrap universe subtask. createDeleteBootstrapIdsTask(xClusterConfig, xClusterConfig.getTableIds(), forceDelete) diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/XClusterConfigTaskBase.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/XClusterConfigTaskBase.java index 1cfc565dae74..5046a6549033 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/XClusterConfigTaskBase.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/XClusterConfigTaskBase.java @@ -2043,6 +2043,32 @@ public static Map getIndexTableIdToParentTableIdMap( tableInfo -> getTableId(tableInfo), tableInfo -> tableInfo.getIndexedTableId())); } + public static List getRequestedTableInfoList( + Set dbIds, + List sourceTableInfoList) { + List requestedTableInfoList = + sourceTableInfoList.stream() + .filter( + tableInfo -> + isXClusterSupported(tableInfo) + && dbIds.contains(tableInfo.getNamespace().getId().toStringUtf8())) + .collect(Collectors.toList()); + Set foundDbIds = + requestedTableInfoList.stream() + .map(tableInfo -> tableInfo.getNamespace().getId().toStringUtf8()) + .collect(Collectors.toSet()); + // Ensure all DB names are found. + if (foundDbIds.size() != dbIds.size()) { + Set missingDbIds = + dbIds.stream().filter(dbId -> !foundDbIds.contains(dbId)).collect(Collectors.toSet()); + throw new IllegalArgumentException( + String.format( + "Some of the DB ids were not found: was %d, found %d, missing dbs: %s", + dbIds.size(), foundDbIds.size(), missingDbIds)); + } + return requestedTableInfoList; + } + // DR methods. // -------------------------------------------------------------------------------- protected DrConfig getDrConfigFromTaskParams() { diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/subtasks/xcluster/WaitForReplicationDrain.java b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/subtasks/xcluster/WaitForReplicationDrain.java index cce1be59a618..1c1db1f3c3df 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/subtasks/xcluster/WaitForReplicationDrain.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/tasks/subtasks/xcluster/WaitForReplicationDrain.java @@ -55,7 +55,8 @@ public void run() { if (!Set.of(ConfigType.Txn, ConfigType.Db).contains(xClusterConfig.getType())) { throw new IllegalArgumentException( String.format( - "WaitForReplicationDrain only works for Txn xCluster; the current type is %s", + "WaitForReplicationDrain only works for Txn or DB scoped xCluster; the current type" + + " is %s", xClusterConfig.getType())); } @@ -91,6 +92,8 @@ public void run() { universe.getUniverseUUID(), xClusterConfig, rgInfo.errorMessage())); } + log.debug("Got namespace infos: {}", rgInfo.getNamespaceInfos()); + rgInfo.getNamespaceInfos().stream() .filter(i -> xClusterConfig.getDbIds().contains(i.getNamespaceId())) .forEach(i -> activeStreamIds.addAll(i.getTableStreamsMap().values())); diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/DrConfigController.java b/managed/src/main/java/com/yugabyte/yw/controllers/DrConfigController.java index a76dc0f63a18..211a208bfee1 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/DrConfigController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/DrConfigController.java @@ -1,5 +1,8 @@ package com.yugabyte.yw.controllers; +import static com.yugabyte.yw.commissioner.tasks.XClusterConfigTaskBase.getRequestedTableInfoList; +import static org.yb.master.MasterReplicationOuterClass.GetUniverseReplicationInfoResponsePB.*; + import com.google.common.collect.Sets; import com.google.inject.Inject; import com.yugabyte.yw.commissioner.Commissioner; @@ -442,30 +445,46 @@ public Result restart( autoFlagUtil.checkSourcePromotedAutoFlagsPromotedOnTarget(sourceUniverse, targetUniverse); } - List sourceTableInfoList = - XClusterConfigTaskBase.getTableInfoList(ybService, sourceUniverse); + log.info("DR state is {}", drConfig.getState()); - // Todo: Always add non existing tables to the xCluster config on restart. - // Empty `dbs` field indicates a request to restart the entire config. - // This is consistent with the restart xCluster config behaviour. - Set tableIds = - CollectionUtils.isEmpty(restartForm.dbs) - ? xClusterConfig.getTableIds() - : XClusterConfigTaskBase.getTableIds( - getRequestedTableInfoList(restartForm.dbs, sourceTableInfoList)); + XClusterConfigTaskParams taskParams; + if (xClusterConfig.getType() != ConfigType.Db) { + List sourceTableInfoList = + XClusterConfigTaskBase.getTableInfoList(ybService, sourceUniverse); - log.info("DR state is {}", drConfig.getState()); - XClusterConfigTaskParams taskParams = - XClusterConfigController.getRestartTaskParams( - ybService, - xClusterConfig, - sourceUniverse, - targetUniverse, - tableIds, - restartForm.bootstrapParams, - false /* dryRun */, - isForceDelete, - drConfig.isHalted() /*isForceBootstrap*/); + // Todo: Always add non existing tables to the xCluster config on restart. + // Empty `dbs` field indicates a request to restart the entire config. + // This is consistent with the restart xCluster config behaviour. + Set tableIds = + CollectionUtils.isEmpty(restartForm.dbs) + ? xClusterConfig.getTableIds() + : XClusterConfigTaskBase.getTableIds( + getRequestedTableInfoList(restartForm.dbs, sourceTableInfoList)); + + taskParams = + XClusterConfigController.getRestartTaskParams( + ybService, + xClusterConfig, + sourceUniverse, + targetUniverse, + tableIds, + restartForm.bootstrapParams, + false /* dryRun */, + isForceDelete, + drConfig.isHalted() /*isForceBootstrap*/); + } else { + taskParams = + XClusterConfigController.getDbScopedRestartTaskParams( + ybService, + xClusterConfig, + sourceUniverse, + targetUniverse, + restartForm.dbs, + restartForm.bootstrapParams, + false /* dryRun */, + isForceDelete, + drConfig.isHalted() /*isForceBootstrap*/); + } UUID taskUUID = commissioner.submit(TaskType.RestartDrConfig, taskParams); CustomerTask.create( @@ -534,64 +553,91 @@ public Result replaceReplica(UUID customerUUID, UUID drConfigUuid, Http.Request autoFlagUtil.checkPromotedAutoFlagsEquality(sourceUniverse, newTargetUniverse); } - Set tableIds = xClusterConfig.getTableIds(); - - // Add index tables. - Map> mainTableIndexTablesMap = - XClusterConfigTaskBase.getMainTableIndexTablesMap(this.ybService, sourceUniverse, tableIds); - Set indexTableIdSet = - mainTableIndexTablesMap.values().stream().flatMap(List::stream).collect(Collectors.toSet()); - tableIds.addAll(indexTableIdSet); - - log.debug("tableIds are {}", tableIds); - - List sourceTableInfoList = - XClusterConfigTaskBase.getTableInfoList(ybService, sourceUniverse); - List requestedTableInfoList = - XClusterConfigTaskBase.filterTableInfoListByTableIds(sourceTableInfoList, tableIds); + DrConfigTaskParams taskParams; + // Create xCluster config object. + XClusterConfig newTargetXClusterConfig = + drConfig.addXClusterConfig( + sourceUniverse.getUniverseUUID(), + newTargetUniverse.getUniverseUUID(), + xClusterConfig.getType()); - XClusterConfigTaskBase.verifyTablesNotInReplication( - tableIds, sourceUniverse.getUniverseUUID(), newTargetUniverse.getUniverseUUID()); - XClusterConfigController.certsForCdcDirGFlagCheck(sourceUniverse, newTargetUniverse); + try { + if (xClusterConfig.getType() != ConfigType.Db) { + Set tableIds = xClusterConfig.getTableIds(); + + // Add index tables. + Map> mainTableIndexTablesMap = + XClusterConfigTaskBase.getMainTableIndexTablesMap( + this.ybService, sourceUniverse, tableIds); + Set indexTableIdSet = + mainTableIndexTablesMap.values().stream() + .flatMap(List::stream) + .collect(Collectors.toSet()); + tableIds.addAll(indexTableIdSet); + + log.debug("tableIds are {}", tableIds); + + List sourceTableInfoList = + XClusterConfigTaskBase.getTableInfoList(ybService, sourceUniverse); + List requestedTableInfoList = + XClusterConfigTaskBase.filterTableInfoListByTableIds(sourceTableInfoList, tableIds); + + XClusterConfigTaskBase.verifyTablesNotInReplication( + tableIds, sourceUniverse.getUniverseUUID(), newTargetUniverse.getUniverseUUID()); + XClusterConfigController.certsForCdcDirGFlagCheck(sourceUniverse, newTargetUniverse); + + List newTargetTableInfoList = + XClusterConfigTaskBase.getTableInfoList(ybService, newTargetUniverse); + Map sourceTableIdNewTargetTableIdMap = + XClusterConfigTaskBase.getSourceTableIdTargetTableIdMap( + requestedTableInfoList, newTargetTableInfoList); + + BootstrapParams bootstrapParams = + getBootstrapParamsFromRestartBootstrapParams( + replaceReplicaForm.bootstrapParams, tableIds); + XClusterConfigController.xClusterBootstrappingPreChecks( + requestedTableInfoList, + sourceTableInfoList, + newTargetUniverse, + sourceUniverse, + sourceTableIdNewTargetTableIdMap, + ybService, + bootstrapParams, + null /* currentReplicationGroupName */); - List newTargetTableInfoList = - XClusterConfigTaskBase.getTableInfoList(ybService, newTargetUniverse); - Map sourceTableIdNewTargetTableIdMap = - XClusterConfigTaskBase.getSourceTableIdTargetTableIdMap( - requestedTableInfoList, newTargetTableInfoList); + newTargetXClusterConfig.updateTables(tableIds, tableIds /* tableIdsNeedBootstrap */); + newTargetXClusterConfig.updateIndexTablesFromMainTableIndexTablesMap( + mainTableIndexTablesMap); + taskParams = + new DrConfigTaskParams( + drConfig, + xClusterConfig, + newTargetXClusterConfig, + bootstrapParams, + requestedTableInfoList, + mainTableIndexTablesMap, + sourceTableIdNewTargetTableIdMap); + } else { + newTargetXClusterConfig.updateNamespaces(xClusterConfig.getDbIds()); + taskParams = + new DrConfigTaskParams( + drConfig, + xClusterConfig, + newTargetXClusterConfig, + newTargetXClusterConfig.getDbIds(), + Collections.emptyMap()); + } - BootstrapParams bootstrapParams = - getBootstrapParamsFromRestartBootstrapParams(replaceReplicaForm.bootstrapParams, tableIds); - XClusterConfigController.xClusterBootstrappingPreChecks( - requestedTableInfoList, - sourceTableInfoList, - newTargetUniverse, - sourceUniverse, - sourceTableIdNewTargetTableIdMap, - ybService, - bootstrapParams, - null /* currentReplicationGroupName */); - - // Todo: add a dryRun option here. + // Todo: add a dryRun option here. - // Create xCluster config object. - XClusterConfig newTargetXClusterConfig = - drConfig.addXClusterConfig( - sourceUniverse.getUniverseUUID(), newTargetUniverse.getUniverseUUID()); - newTargetXClusterConfig.updateTables(tableIds, tableIds /* tableIdsNeedBootstrap */); - newTargetXClusterConfig.updateIndexTablesFromMainTableIndexTablesMap(mainTableIndexTablesMap); - newTargetXClusterConfig.setSecondary(true); + newTargetXClusterConfig.setSecondary(true); + newTargetXClusterConfig.update(); + } catch (Exception e) { + newTargetXClusterConfig.delete(); + throw e; + } // Submit task to set up xCluster config. - DrConfigTaskParams taskParams = - new DrConfigTaskParams( - drConfig, - xClusterConfig, - newTargetXClusterConfig, - bootstrapParams, - requestedTableInfoList, - mainTableIndexTablesMap, - sourceTableIdNewTargetTableIdMap); UUID taskUUID = commissioner.submit(TaskType.EditDrConfig, taskParams); CustomerTask.create( customer, @@ -771,7 +817,7 @@ public Result switchover(UUID customerUUID, UUID drConfigUuid, Http.Request requ ybService, targetUniverse, xClusterConfig.getReplicationGroupName()) .getDbScopedInfos() .stream() - .map(i -> i.getTargetNamespaceId()) + .map(DbScopedInfoPB::getTargetNamespaceId) .collect(Collectors.toSet())); } catch (Exception e) { throw new PlatformServiceException( @@ -853,55 +899,111 @@ public Result failover(UUID customerUUID, UUID drConfigUuid, Http.Request reques Universe targetUniverse = Universe.getOrBadRequest(xClusterConfig.getTargetUniverseUUID(), customer); + DrConfigTaskParams taskParams; + Set namespaceIdsWithSafetime = failoverForm.namespaceIdSafetimeEpochUsMap.keySet(); + Set namespaceIdsWithoutSafetime; // Todo: Add pre-checks for user's input safetime. + XClusterConfig failoverXClusterConfig = + drConfig.addXClusterConfig( + xClusterConfig.getTargetUniverseUUID(), + xClusterConfig.getSourceUniverseUUID(), + xClusterConfig.getType()); - List targetTableInfoList = - XClusterConfigTaskBase.getTableInfoList(ybService, targetUniverse); - - // Because during failover, the source universe could be down, we should rely on the target - // universe to get the table map between source to target. - Map sourceTableIdTargetTableIdMap = - xClusterUniverseService.getSourceTableIdTargetTableIdMap( - targetUniverse, xClusterConfig.getReplicationGroupName()); - - // All tables must have corresponding tables on the target universe. - Set sourceTableIdsWithNoTableOnTargetUniverse = - sourceTableIdTargetTableIdMap.entrySet().stream() - .filter(entry -> Objects.isNull(entry.getValue())) - .map(Entry::getKey) - .collect(Collectors.toSet()); - if (!sourceTableIdsWithNoTableOnTargetUniverse.isEmpty()) { - throw new PlatformServiceException( - BAD_REQUEST, - String.format( - "The following tables are in replication with no corresponding table on the " - + "target universe: %s. This can happen if the table is dropped without being " - + "removed from replication first. You may fix this issue by running `Reconcile " - + "config with DB` from UI", - sourceTableIdsWithNoTableOnTargetUniverse)); + try { + if (xClusterConfig.getType() != ConfigType.Db) { + List targetTableInfoList = + XClusterConfigTaskBase.getTableInfoList(ybService, targetUniverse); + + // Because during failover, the source universe could be down, we should rely on the target + // universe to get the table map between source to target. + Map sourceTableIdTargetTableIdMap = + xClusterUniverseService.getSourceTableIdTargetTableIdMap( + targetUniverse, xClusterConfig.getReplicationGroupName()); + + // All tables must have corresponding tables on the target universe. + Set sourceTableIdsWithNoTableOnTargetUniverse = + sourceTableIdTargetTableIdMap.entrySet().stream() + .filter(entry -> Objects.isNull(entry.getValue())) + .map(Entry::getKey) + .collect(Collectors.toSet()); + if (!sourceTableIdsWithNoTableOnTargetUniverse.isEmpty()) { + throw new PlatformServiceException( + BAD_REQUEST, + String.format( + "The following tables are in replication with no corresponding table on the" + + " target universe: %s. This can happen if the table is dropped without" + + " being removed from replication first. You may fix this issue by running" + + " `Reconcile config with DB` from UI", + sourceTableIdsWithNoTableOnTargetUniverse)); + } + + // Use table IDs on the target universe for failover xCluster. + Set tableIds = new HashSet<>(sourceTableIdTargetTableIdMap.values()); + List requestedTableInfoList = + XClusterConfigTaskBase.filterTableInfoListByTableIds(targetTableInfoList, tableIds); + + drSwitchoverFailoverPreChecks( + CustomerTask.TaskType.Failover, + requestedTableInfoList, + targetTableInfoList, + targetUniverse, + sourceUniverse); + Map> mainTableIndexTablesMap = + XClusterConfigTaskBase.getMainTableIndexTablesMap(ybService, targetUniverse, tableIds); + + // Make sure the safetime for all the namespaces is specified. + namespaceIdsWithoutSafetime = + XClusterConfigTaskBase.getNamespaces(requestedTableInfoList).stream() + .map(namespace -> namespace.getId().toStringUtf8()) + .filter(namespaceId -> !namespaceIdsWithSafetime.contains(namespaceId)) + .collect(Collectors.toSet()); + taskParams = + new DrConfigTaskParams( + drConfig, + xClusterConfig, + failoverXClusterConfig, + failoverForm.namespaceIdSafetimeEpochUsMap, + requestedTableInfoList, + mainTableIndexTablesMap); + failoverXClusterConfig.updateTables(tableIds, null /* tableIdsNeedBootstrap */); + failoverXClusterConfig.updateIndexTablesFromMainTableIndexTablesMap( + mainTableIndexTablesMap); + } else { + try { + Set namespacesInReplication = + XClusterConfigTaskBase.getUniverseReplicationInfo( + ybService, targetUniverse, xClusterConfig.getReplicationGroupName()) + .getDbScopedInfos() + .stream() + .map(i -> i.getTargetNamespaceId()) + .collect(Collectors.toSet()); + namespaceIdsWithoutSafetime = + Sets.difference(namespacesInReplication, namespaceIdsWithSafetime); + + failoverXClusterConfig.updateNamespaces(namespacesInReplication); + } catch (Exception e) { + throw new PlatformServiceException( + INTERNAL_SERVER_ERROR, + String.format( + "Failed to get target namespace IDs for group %s", + xClusterConfig.getReplicationGroupName())); + } + + taskParams = + new DrConfigTaskParams( + drConfig, + xClusterConfig, + failoverXClusterConfig, + failoverXClusterConfig.getDbIds(), + failoverForm.namespaceIdSafetimeEpochUsMap); + } + } catch (Exception e) { + failoverXClusterConfig.delete(); + throw e; } - // Use table IDs on the target universe for failover xCluster. - Set tableIds = new HashSet<>(sourceTableIdTargetTableIdMap.values()); - List requestedTableInfoList = - XClusterConfigTaskBase.filterTableInfoListByTableIds(targetTableInfoList, tableIds); - drSwitchoverFailoverPreChecks( - CustomerTask.TaskType.Failover, - requestedTableInfoList, - targetTableInfoList, - targetUniverse, - sourceUniverse); - Map> mainTableIndexTablesMap = - XClusterConfigTaskBase.getMainTableIndexTablesMap(ybService, targetUniverse, tableIds); - - // Make sure the safetime for all the namespaces is specified. - Set namespaceIdsWithSafetime = failoverForm.namespaceIdSafetimeEpochUsMap.keySet(); - Set namespaceIdsWithoutSafetime = - XClusterConfigTaskBase.getNamespaces(requestedTableInfoList).stream() - .map(namespace -> namespace.getId().toStringUtf8()) - .filter(namespaceId -> !namespaceIdsWithSafetime.contains(namespaceId)) - .collect(Collectors.toSet()); if (!namespaceIdsWithoutSafetime.isEmpty()) { + failoverXClusterConfig.delete(); throw new PlatformServiceException( BAD_REQUEST, String.format( @@ -910,25 +1012,10 @@ public Result failover(UUID customerUUID, UUID drConfigUuid, Http.Request reques namespaceIdsWithoutSafetime)); } - XClusterConfig failoverXClusterConfig = - drConfig.addXClusterConfig( - xClusterConfig.getTargetUniverseUUID(), - xClusterConfig.getSourceUniverseUUID(), - xClusterConfig.getType()); - failoverXClusterConfig.updateTables(tableIds, null /* tableIdsNeedBootstrap */); - failoverXClusterConfig.updateIndexTablesFromMainTableIndexTablesMap(mainTableIndexTablesMap); failoverXClusterConfig.setSecondary(true); + failoverXClusterConfig.update(); // Submit task to set up xCluster config. - DrConfigTaskParams taskParams = - new DrConfigTaskParams( - drConfig, - xClusterConfig, - failoverXClusterConfig, - failoverForm.namespaceIdSafetimeEpochUsMap, - requestedTableInfoList, - mainTableIndexTablesMap); - UUID taskUUID = commissioner.submit(TaskType.FailoverDrConfig, taskParams); CustomerTask.create( customer, @@ -1344,32 +1431,6 @@ private void validateBackupRequestParamsForBootstrapping( customerConfigService, backupHelper, bootstrapBackupParams, customerUUID); } - private List getRequestedTableInfoList( - Set dbIds, - List sourceTableInfoList) { - List requestedTableInfoList = - sourceTableInfoList.stream() - .filter( - tableInfo -> - XClusterConfigTaskBase.isXClusterSupported(tableInfo) - && dbIds.contains(tableInfo.getNamespace().getId().toStringUtf8())) - .collect(Collectors.toList()); - Set foundDbIds = - requestedTableInfoList.stream() - .map(tableInfo -> tableInfo.getNamespace().getId().toStringUtf8()) - .collect(Collectors.toSet()); - // Ensure all DB names are found. - if (foundDbIds.size() != dbIds.size()) { - Set missingDbIds = - dbIds.stream().filter(dbId -> !foundDbIds.contains(dbId)).collect(Collectors.toSet()); - throw new IllegalArgumentException( - String.format( - "Some of the DB ids were not found: was %d, found %d, missing dbs: %s", - dbIds.size(), foundDbIds.size(), missingDbIds)); - } - return requestedTableInfoList; - } - private static BootstrapParams getBootstrapParamsFromRestartBootstrapParams( @Nullable XClusterConfigRestartFormData.RestartBootstrapParams restartBootstrapParams, Set tableIds) { diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/XClusterConfigController.java b/managed/src/main/java/com/yugabyte/yw/controllers/XClusterConfigController.java index 9e32f687d153..faae4b2b633f 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/XClusterConfigController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/XClusterConfigController.java @@ -911,6 +911,7 @@ static XClusterConfigTaskParams getRestartTaskParams( boolean dryRun, boolean isForceDelete, boolean isForceBootstrap) { + // Add index tables. Map> mainTableIndexTablesMap = XClusterConfigTaskBase.getMainTableIndexTablesMap(ybService, sourceUniverse, tableIds); @@ -963,6 +964,32 @@ static XClusterConfigTaskParams getRestartTaskParams( isForceBootstrap); } + static XClusterConfigTaskParams getDbScopedRestartTaskParams( + YBClientService ybService, + XClusterConfig xClusterConfig, + Universe sourceUniverse, + Universe targetUniverse, + Set dbIds, + RestartBootstrapParams restartBootstrapParams, + boolean dryRun, + boolean isForceDelete, + boolean isForceBootstrap) { + + XClusterConfigCreateFormData.BootstrapParams bootstrapParams = null; + if (restartBootstrapParams != null) { + bootstrapParams = new XClusterConfigCreateFormData.BootstrapParams(); + bootstrapParams.backupRequestParams = restartBootstrapParams.backupRequestParams; + bootstrapParams.tables = new HashSet<>(); + } + + return new XClusterConfigTaskParams( + xClusterConfig, + bootstrapParams, + CollectionUtils.isEmpty(dbIds) ? xClusterConfig.getDbIds() : dbIds, + null, + isForceBootstrap); + } + /** * API that deletes an xCluster replication configuration. * diff --git a/managed/src/main/java/com/yugabyte/yw/forms/XClusterConfigTaskParams.java b/managed/src/main/java/com/yugabyte/yw/forms/XClusterConfigTaskParams.java index cd7f6ffc8d20..4c17e3ccbc6b 100644 --- a/managed/src/main/java/com/yugabyte/yw/forms/XClusterConfigTaskParams.java +++ b/managed/src/main/java/com/yugabyte/yw/forms/XClusterConfigTaskParams.java @@ -85,6 +85,16 @@ public XClusterConfigTaskParams( this.pitrParams = pitrParams; } + public XClusterConfigTaskParams( + XClusterConfig xClusterConfig, + XClusterConfigCreateFormData.BootstrapParams bootstrapParams, + Set dbs, + @Nullable DrConfigCreateForm.PitrParams pitrParams, + boolean isForceBootstrap) { + this(xClusterConfig, bootstrapParams, dbs, pitrParams); + this.isForceBootstrap = isForceBootstrap; + } + /** It is used in the edit method. */ public XClusterConfigTaskParams( XClusterConfig xClusterConfig, diff --git a/managed/src/test/java/com/yugabyte/yw/controllers/DrConfigControllerTest.java b/managed/src/test/java/com/yugabyte/yw/controllers/DrConfigControllerTest.java index 2954a4482c63..d737cc56ceec 100644 --- a/managed/src/test/java/com/yugabyte/yw/controllers/DrConfigControllerTest.java +++ b/managed/src/test/java/com/yugabyte/yw/controllers/DrConfigControllerTest.java @@ -10,12 +10,14 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static play.inject.Bindings.bind; @@ -23,6 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.yugabyte.yw.commissioner.Commissioner; import com.yugabyte.yw.commissioner.XClusterScheduler; +import com.yugabyte.yw.common.DrConfigStates.State; import com.yugabyte.yw.common.ModelFactory; import com.yugabyte.yw.common.PlatformGuiceApplicationBaseTest; import com.yugabyte.yw.common.PlatformServiceException; @@ -33,11 +36,15 @@ import com.yugabyte.yw.common.gflags.AutoFlagUtil; import com.yugabyte.yw.common.services.YBClientService; import com.yugabyte.yw.forms.DrConfigCreateForm; +import com.yugabyte.yw.forms.DrConfigFailoverForm; +import com.yugabyte.yw.forms.DrConfigReplaceReplicaForm; +import com.yugabyte.yw.forms.DrConfigRestartForm; import com.yugabyte.yw.forms.DrConfigSetDatabasesForm; import com.yugabyte.yw.forms.DrConfigSwitchoverForm; import com.yugabyte.yw.forms.DrConfigTaskParams; import com.yugabyte.yw.forms.XClusterConfigCreateFormData.BootstrapParams.BootstrapBackupParams; import com.yugabyte.yw.forms.XClusterConfigRestartFormData.RestartBootstrapParams; +import com.yugabyte.yw.forms.XClusterConfigTaskParams; import com.yugabyte.yw.metrics.MetricQueryHelper; import com.yugabyte.yw.models.Customer; import com.yugabyte.yw.models.DrConfig; @@ -50,8 +57,10 @@ import com.yugabyte.yw.models.configs.CustomerConfig; import com.yugabyte.yw.models.helpers.TaskType; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.UUID; import org.junit.Before; @@ -358,21 +367,8 @@ public void testCreateDbScopedDisabledFailure() { assertBadRequest(result, "db scoped disaster recovery configs is disabled"); } - @Test - public void testDbScopedSwitchover() throws Exception { - String sourceNamespace = "sourceNamespace"; - DrConfig drConfig = - DrConfig.create( - "test", - sourceUniverse.getUniverseUUID(), - targetUniverse.getUniverseUUID(), - new BootstrapBackupParams(), - Set.of(sourceNamespace)); - drConfig.getActiveXClusterConfig().setStatus(XClusterConfigStatusType.Running); - drConfig.getActiveXClusterConfig().update(); - UUID taskUUID = buildTaskInfo(null, TaskType.SwitchoverDrConfig); - when(mockCommissioner.submit(any(), any())).thenReturn(taskUUID); - String targetNamespace = "targetNamespace"; + private void setupMockGetUniverseReplicationInfo( + DrConfig drConfig, String sourceNamespace, String targetNamespace) throws Exception { GetUniverseReplicationInfoResponse mockResponse = new GetUniverseReplicationInfoResponse( 0, @@ -389,6 +385,24 @@ public void testDbScopedSwitchover() throws Exception { when(mockYBClient.getUniverseReplicationInfo( eq(drConfig.getActiveXClusterConfig().getReplicationGroupName()))) .thenReturn(mockResponse); + } + + @Test + public void testDbScopedSwitchover() throws Exception { + String sourceNamespace = "sourceNamespace"; + DrConfig drConfig = + DrConfig.create( + "test", + sourceUniverse.getUniverseUUID(), + targetUniverse.getUniverseUUID(), + new BootstrapBackupParams(), + Set.of(sourceNamespace)); + drConfig.getActiveXClusterConfig().setStatus(XClusterConfigStatusType.Running); + drConfig.getActiveXClusterConfig().update(); + UUID taskUUID = buildTaskInfo(null, TaskType.SwitchoverDrConfig); + when(mockCommissioner.submit(any(), any())).thenReturn(taskUUID); + String targetNamespace = "targetNamespace"; + setupMockGetUniverseReplicationInfo(drConfig, sourceNamespace, targetNamespace); ListTablesResponse mockListTablesResponse = mock(ListTablesResponse.class); when(mockListTablesResponse.getTableInfoList()).thenReturn(Collections.emptyList()); when(mockYBClient.getTablesList(nullable(String.class), eq(false), nullable(String.class))) @@ -438,4 +452,187 @@ public void testDbScopedSwitchover() throws Exception { assertEquals(XClusterNamespaceConfig.Status.Validated, namespaceConfig.getStatus()); assertTrue(switchoverConfig.getTableDetails().isEmpty()); } + + @Test + public void testDbScopedFailoverFailsWithSafetimeMissing() throws Exception { + String sourceNamespace = "sourceNamespace"; + DrConfig drConfig = + DrConfig.create( + "test", + sourceUniverse.getUniverseUUID(), + targetUniverse.getUniverseUUID(), + new BootstrapBackupParams(), + Set.of(sourceNamespace)); + drConfig.getActiveXClusterConfig().setStatus(XClusterConfigStatusType.Running); + drConfig.getActiveXClusterConfig().update(); + + String targetNamespace = "targetNamespace"; + setupMockGetUniverseReplicationInfo(drConfig, sourceNamespace, targetNamespace); + + DrConfigFailoverForm form = new DrConfigFailoverForm(); + form.primaryUniverseUuid = sourceUniverse.getUniverseUUID(); + form.drReplicaUniverseUuid = targetUniverse.getUniverseUUID(); + form.namespaceIdSafetimeEpochUsMap = new HashMap<>(); + + Result result = + assertPlatformException( + () -> + doRequestWithAuthTokenAndBody( + "POST", + String.format( + "/api/customers/%s/dr_configs/%s/failover", + defaultCustomer.getUuid(), drConfig.getUuid()), + authToken, + Json.toJson(form))); + + assertBadRequest(result, "Safetime must be specified for all the databases"); + assertEquals(1, drConfig.getXClusterConfigs().size()); + } + + @Test + public void testDbScopedFailover() throws Exception { + String sourceNamespace = "sourceNamespace"; + DrConfig drConfig = + DrConfig.create( + "test", + sourceUniverse.getUniverseUUID(), + targetUniverse.getUniverseUUID(), + new BootstrapBackupParams(), + Set.of(sourceNamespace)); + drConfig.getActiveXClusterConfig().setStatus(XClusterConfigStatusType.Running); + drConfig.getActiveXClusterConfig().update(); + UUID taskUUID = buildTaskInfo(null, TaskType.FailoverDrConfig); + when(mockCommissioner.submit(any(), any())).thenReturn(taskUUID); + + String targetNamespace = "targetNamespace"; + setupMockGetUniverseReplicationInfo(drConfig, sourceNamespace, targetNamespace); + + DrConfigFailoverForm form = new DrConfigFailoverForm(); + form.primaryUniverseUuid = sourceUniverse.getUniverseUUID(); + form.drReplicaUniverseUuid = targetUniverse.getUniverseUUID(); + form.namespaceIdSafetimeEpochUsMap = Map.of(targetNamespace, 100L); + + Result result = + doRequestWithAuthTokenAndBody( + "POST", + String.format( + "/api/customers/%s/dr_configs/%s/failover", + defaultCustomer.getUuid(), drConfig.getUuid()), + authToken, + Json.toJson(form)); + + assertOk(result); + verify(mockYBClient) + .getUniverseReplicationInfo( + eq(drConfig.getActiveXClusterConfig().getReplicationGroupName())); + + ArgumentCaptor paramsArgumentCaptor = + ArgumentCaptor.forClass(DrConfigTaskParams.class); + verify(mockCommissioner).submit(eq(TaskType.FailoverDrConfig), paramsArgumentCaptor.capture()); + + DrConfigTaskParams params = paramsArgumentCaptor.getValue(); + assertEquals(drConfig.getUuid(), params.getDrConfig().getUuid()); + assertEquals(1, params.getDbs().size()); + assertEquals(targetNamespace, params.getDbs().iterator().next()); + assertEquals(form.namespaceIdSafetimeEpochUsMap, params.getNamespaceIdSafetimeEpochUsMap()); + assertTrue(params.getMainTableIndexTablesMap().isEmpty()); + assertTrue(params.getTableInfoList().isEmpty()); + assertTrue(params.getSourceTableIdsWithNoTableOnTargetUniverse().isEmpty()); + + XClusterConfig oldXClusterConfig = params.getOldXClusterConfig(); + assertEquals(drConfig.getActiveXClusterConfig().getUuid(), oldXClusterConfig.getUuid()); + + XClusterConfig failoverConfig = params.getXClusterConfig(); + assertEquals(oldXClusterConfig.getType(), failoverConfig.getType()); + drConfig.refresh(); + assertEquals(2, drConfig.getXClusterConfigs().size()); + assertEquals(failoverConfig.getUuid(), drConfig.getFailoverXClusterConfig().getUuid()); + assertEquals(1, failoverConfig.getNamespaces().size()); + XClusterNamespaceConfig namespaceConfig = failoverConfig.getNamespaces().iterator().next(); + assertEquals(targetNamespace, namespaceConfig.getSourceNamespaceId()); + assertEquals(XClusterNamespaceConfig.Status.Validated, namespaceConfig.getStatus()); + assertTrue(failoverConfig.getTableDetails().isEmpty()); + } + + @Test + public void testDbScopedRepair() throws Exception { + String sourceNamespace = "sourceNamespace"; + DrConfig drConfig = + DrConfig.create( + "test", + sourceUniverse.getUniverseUUID(), + targetUniverse.getUniverseUUID(), + new BootstrapBackupParams(), + Set.of(sourceNamespace)); + drConfig.setState(State.Halted); + drConfig.getActiveXClusterConfig().setStatus(XClusterConfigStatusType.Initialized); + drConfig.update(); + UUID taskUUID = buildTaskInfo(null, TaskType.RestartDrConfig); + when(mockCommissioner.submit(any(), any())).thenReturn(taskUUID); + String targetNamespace = "targetNamespace"; + + DrConfigRestartForm form = new DrConfigRestartForm(); + form.dbs = Set.of(sourceNamespace); + + Result result = + doRequestWithAuthTokenAndBody( + "POST", + String.format( + "/api/customers/%s/dr_configs/%s/restart", + defaultCustomer.getUuid(), drConfig.getUuid()), + authToken, + Json.toJson(form)); + + assertOk(result); + ArgumentCaptor paramsArgumentCaptor = + ArgumentCaptor.forClass(XClusterConfigTaskParams.class); + verify(mockCommissioner).submit(eq(TaskType.RestartDrConfig), paramsArgumentCaptor.capture()); + XClusterConfigTaskParams params = paramsArgumentCaptor.getValue(); + assertNull(params.getPitrParams()); + assertEquals(drConfig.getActiveXClusterConfig().getDbIds(), params.getDbs()); + assertTrue(params.isForceBootstrap()); + } + + @Test + public void testDbScopedReplicaReplacement() throws Exception { + Universe newReplica = createUniverse("new replication target"); + DrConfig drConfig = + spy( + DrConfig.create( + "test", + sourceUniverse.getUniverseUUID(), + targetUniverse.getUniverseUUID(), + new BootstrapBackupParams(), + Set.of("sourceNamespace"))); + drConfig.update(); + UUID taskUUID = buildTaskInfo(null, TaskType.EditDrConfig); + when(mockCommissioner.submit(any(), any())).thenReturn(taskUUID); + + DrConfigReplaceReplicaForm form = new DrConfigReplaceReplicaForm(); + form.primaryUniverseUuid = sourceUniverse.getUniverseUUID(); + form.drReplicaUniverseUuid = newReplica.getUniverseUUID(); + + Result result = + doRequestWithAuthTokenAndBody( + "POST", + String.format( + "/api/customers/%s/dr_configs/%s/replace_replica", + defaultCustomer.getUuid(), drConfig.getUuid()), + authToken, + Json.toJson(form)); + + assertOk(result); + ArgumentCaptor paramsArgumentCaptor = + ArgumentCaptor.forClass(XClusterConfigTaskParams.class); + verify(mockCommissioner).submit(eq(TaskType.EditDrConfig), paramsArgumentCaptor.capture()); + XClusterConfigTaskParams params = paramsArgumentCaptor.getValue(); + assertEquals(drConfig.getActiveXClusterConfig().getDbIds(), params.getDbs()); + assertNull(params.getPitrParams()); + + drConfig.refresh(); + XClusterConfig newConfig = drConfig.getFailoverXClusterConfig(); + assertNotNull(newConfig); + assertEquals(newConfig.getDbIds(), drConfig.getActiveXClusterConfig().getDbIds()); + assertTrue(newConfig.getTableIds().isEmpty()); + } } From 9e046fbebf69e7cc40419fe7b33ab5e933c958f4 Mon Sep 17 00:00:00 2001 From: Devansh Saxena Date: Mon, 22 Jul 2024 22:23:37 +0530 Subject: [PATCH 150/154] [#23163] YSQL: pg_partman: make 'inherit_template_properties' idempotent Summary: Currently transactional DDL is not supported in YugabyteDB . Due to which if any procedure or function which is performing multiple DDLs in a transactional context can lead to issue of some DDLs getting executed and committed even if stored procedure failed due to some exception while running stored procedure or Postgres backend process or tserver process kill. This diff makes `inherit_template_properties` function idempotent such that multiple calls to don't have any additional consequences. - This function is used to inherit the properties of the template table to newly created child tables. - For PG11, it is used to inherit non-partition-key unique indexes & primary keys. - Changes Done - Before creating a new index on the child table check if that index is already present for the child table to avoid duplicate index creation. Jira: DB-12101 Test Plan: jenkins: compile only Reviewers: skumar, jason, hsunder Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D36676 --- .../functions/inherit_template_properties.sql | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/postgres/third-party-extensions/pg_partman/sql/functions/inherit_template_properties.sql b/src/postgres/third-party-extensions/pg_partman/sql/functions/inherit_template_properties.sql index a0183abf88c2..a1fc4362d636 100644 --- a/src/postgres/third-party-extensions/pg_partman/sql/functions/inherit_template_properties.sql +++ b/src/postgres/third-party-extensions/pg_partman/sql/functions/inherit_template_properties.sql @@ -22,6 +22,8 @@ v_template_table text; v_template_tablename name; v_template_tablespace name; v_template_unlogged char; +yb_v_child_index_found boolean := false; +yb_v_child_index_list record; BEGIN /* @@ -100,6 +102,7 @@ IF current_setting('server_version_num')::int >= 100000 THEN ORDER BY 1 LOOP v_dupe_found := false; + yb_v_child_index_found := false; IF current_setting('server_version_num')::int >= 110000 THEN FOR v_parent_index_list IN @@ -140,6 +143,43 @@ IF current_setting('server_version_num')::int >= 100000 THEN CONTINUE; END IF; + -- YB: Check for existing index on child table + FOR yb_v_child_index_list IN + SELECT + array_to_string(regexp_matches(pg_get_indexdef(indexrelid), ' USING .*'),',') AS statement + , i.indisprimary + , ( SELECT array_agg(a.attname ORDER by x.r) + FROM pg_catalog.pg_attribute a + JOIN ( SELECT k, row_number() over () as r + FROM unnest(i.indkey) k ) as x + ON a.attnum = x.k AND a.attrelid = i.indrelid + ) AS indkey_names + FROM pg_catalog.pg_index i + WHERE i.indrelid = ( SELECT oid FROM pg_catalog.pg_class WHERE relname = p_child_tablename AND relnamespace = ( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = p_child_schema )) + AND i.indisvalid + ORDER BY 1 + LOOP + IF yb_v_child_index_list.indisprimary = v_index_list.indisprimary THEN + IF yb_v_child_index_list.indisprimary THEN + IF yb_v_child_index_list.indkey_names = v_index_list.indkey_names THEN + RAISE DEBUG 'inherit_template_properties: Duplicate primary key found on child table: %', v_index_list.indkey_names; + yb_v_child_index_found := true; + CONTINUE; -- skip creating this index + END IF; + END IF; + END IF; + + IF yb_v_child_index_list.statement = v_index_list.statement THEN + RAISE DEBUG 'inherit_template_properties: Duplicate index found on child table: %', v_index_list.statement; + yb_v_child_index_found := true; + CONTINUE; -- skip creating this index + END IF; + END LOOP; + + IF yb_v_child_index_found THEN + CONTINUE; + END IF; + IF v_index_list.indisprimary THEN v_sql := format('ALTER TABLE %I.%I ADD PRIMARY KEY (%s)' , v_child_schema From 2248dcd669d286b29a6a8b60fcca093623748a6f Mon Sep 17 00:00:00 2001 From: Devansh Saxena Date: Mon, 22 Jul 2024 22:55:27 +0530 Subject: [PATCH 151/154] [#23163] YSQL: pg_partman: make 'apply_publications' idempotent Summary: Currently transactional DDL is not supported in YugabyteDB . Due to which if any procedure or function which is performing multiple DDLs in a transactional context can lead to issue of some DDLs getting executed and committed even if stored procedure failed due to some exception while running stored procedure or Postgres backend process or tserver process kill. This diff makes apply_publications.sql function idempotent such that multiple calls to don't have any additional consequences. - This function is used to add child tables to publication - Changes done - Added a check to not invoke ALTER PUBLICATION ADD table if child_table is already part of the publication. Jira: DB-12101 Test Plan: jenkins: compile only Reviewers: skumar, jason, hsunder Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D36677 --- .../sql/functions/apply_publications.sql | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/postgres/third-party-extensions/pg_partman/sql/functions/apply_publications.sql b/src/postgres/third-party-extensions/pg_partman/sql/functions/apply_publications.sql index 3c318d82bdef..61392bb85ada 100644 --- a/src/postgres/third-party-extensions/pg_partman/sql/functions/apply_publications.sql +++ b/src/postgres/third-party-extensions/pg_partman/sql/functions/apply_publications.sql @@ -5,6 +5,7 @@ DECLARE v_publications text[]; v_row record; v_sql text; + yb_v_table_exists boolean; BEGIN /* * Function to ATLER PUBLICATION ... ADD TABLE to support logical replication @@ -18,9 +19,23 @@ WHERE c.parent_table = p_parent_table; FOR v_row IN SELECT pubname FROM unnest(v_publications) AS pubname LOOP - v_sql = format('ALTER PUBLICATION %I ADD TABLE %I.%I', v_row.pubname, p_child_schema, p_child_tablename); - RAISE DEBUG '%', v_sql; - EXECUTE v_sql; + + SELECT EXISTS ( + SELECT 1 + FROM pg_publication_rel pr + JOIN pg_class c ON pr.prrelid = c.oid + JOIN pg_namespace n ON c.relnamespace = n.oid + JOIN pg_publication p ON pr.prpubid = p.oid + WHERE c.relname = p_child_tablename + AND n.nspname = p_child_schema + AND p.pubname = v_row.pubname + ) INTO yb_v_table_exists; + + IF NOT yb_v_table_exists THEN + v_sql = format('ALTER PUBLICATION %I ADD TABLE %I.%I', v_row.pubname, p_child_schema, p_child_tablename); + RAISE DEBUG '%', v_sql; + EXECUTE v_sql; + END IF; END LOOP; END; From 7b32d05895d50fe3fd273548832bae4d4bd69fbf Mon Sep 17 00:00:00 2001 From: Devansh Saxena Date: Tue, 23 Jul 2024 00:29:24 +0530 Subject: [PATCH 152/154] [#23163] YSQL: pg_partman: Make partition creation idempotent Summary: Currently transactional DDL is not supported in YugabyteDB . Due to which if any procedure or function which are performing multiple DDLs in a transactional context can lead to issue of DDLs getting executed and committed even if stored procedure failed due to some exception while running stored procedure or ungraceful Postgres backend process or tserver process kill. pg_partman extension uses `create_parent` function as main function to create child partitions of a partitioned table. `create_parent` itself calls other pg_partman functions that performs DDLs to create and attach partitioned tables and add some other objects like indexes, constraints and adding privileges. Hence it required to make complete workflow of `create_parent` idempotent. create_parent.sql - Base function called for creating child partitions for a partitioned table. - Changes done - Make default table creation idempotent with not-exist addition - Check before attaching default table if it is already attached create_partition_time/id.sql - Functions called by create_parent and run_maintenance. Creation and attaching of child tables except for the default child table occurs here. the default child is handled at create_parent only. - Changes done - Get list of child tables attached to parent table into v_child_tables - Loop over the partition names for which want to create and attach new partition, name it is partition_name - If partition_name is present in v_child_tables, then continue - If partition_name is not attached but created, then skip creation -> have to test this -> made changes. Jira: DB-12101 Test Plan: jenkins: compile only Reviewers: skumar, hsunder, jason Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D36428 --- .../sql/functions/create_parent.sql | 10 +++- .../sql/functions/create_partition_id.sql | 35 ++++++++++- .../sql/functions/create_partition_time.sql | 60 +++++++++++++++---- 3 files changed, 91 insertions(+), 14 deletions(-) diff --git a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_parent.sql b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_parent.sql index 75c09cea6ee8..567f392656ae 100644 --- a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_parent.sql +++ b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_parent.sql @@ -74,6 +74,7 @@ v_top_datetime_string text; v_top_parent_schema text := split_part(p_parent_table, '.', 1); v_top_parent_table text := split_part(p_parent_table, '.', 2); v_unlogged char; +yb_v_parent_table_default regclass; BEGIN /* @@ -744,7 +745,7 @@ IF p_type = 'native' AND current_setting('server_version_num')::int >= 110000 TH */ -- Same INCLUDING list is used in create_partition_*(). INDEXES is handled when partition is attached if it's supported. - v_sql := v_sql || format(' TABLE %I.%I (LIKE %I.%I INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING STORAGE INCLUDING COMMENTS ' + v_sql := v_sql || format(' TABLE IF NOT EXISTS %I.%I (LIKE %I.%I INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING STORAGE INCLUDING COMMENTS ' , v_parent_schema, v_default_partition, v_parent_schema, v_parent_tablename); IF current_setting('server_version_num')::int >= 120000 THEN v_sql := v_sql || ' INCLUDING GENERATED '; @@ -753,7 +754,12 @@ IF p_type = 'native' AND current_setting('server_version_num')::int >= 110000 TH EXECUTE v_sql; v_sql := format('ALTER TABLE %I.%I ATTACH PARTITION %I.%I DEFAULT' , v_parent_schema, v_parent_tablename, v_parent_schema, v_default_partition); - EXECUTE v_sql; + SELECT inhparent::regclass INTO yb_v_parent_table_default + FROM pg_inherits + WHERE inhrelid = (quote_ident(v_parent_schema) || '.' || quote_ident(v_default_partition))::regclass; + IF yb_v_parent_table_default is NULL THEN + EXECUTE v_sql; + END IF; IF p_publications IS NOT NULL THEN -- NOTE: Native publication inheritance is only supported on PG14+ diff --git a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_id.sql b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_id.sql index e4eb825cd83a..0bf15bef6b4b 100644 --- a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_id.sql +++ b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_id.sql @@ -41,12 +41,27 @@ v_sub_id_max bigint; v_sub_id_min bigint; v_template_table text; v_unlogged char; +yb_v_child_tables text[] := '{}'; +yb_v_child_table record; +yb_v_is_child_table_attached boolean; BEGIN /* * Function to create id partitions */ +-- Fetch child tables using pg_inherits +FOR yb_v_child_table IN + SELECT child.relname + FROM pg_inherits + JOIN pg_class parent ON pg_inherits.inhparent = parent.oid + JOIN pg_class child ON pg_inherits.inhrelid = child.oid + WHERE parent.relname = split_part(p_parent_table, '.', 2) +LOOP + -- Append each child table name to the array + yb_v_child_tables := array_append(yb_v_child_tables, yb_v_child_table.relname::text); +END LOOP; + SELECT control , partition_type , partition_interval @@ -114,15 +129,29 @@ FOREACH v_id IN ARRAY p_partition_ids LOOP END IF; v_partition_name := @extschema@.check_name_length(v_parent_tablename, v_id::text, TRUE); + + -- YB: check if child table is already attached + yb_v_is_child_table_attached := v_partition_name = ANY(yb_v_child_tables); + IF yb_v_is_child_table_attached THEN + RAISE NOTICE 'Table % already attached', v_partition_name; + v_partition_created := true; + CONTINUE; + END IF; + -- If child table already exists, skip creation -- Have to check pg_class because if subpartitioned, table will not be in pg_tables SELECT c.relname INTO v_exists FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = v_parent_schema::name AND c.relname = v_partition_name::name; + /* YB: Don't continue whole loop iteration, there could be + case that child partition was created but not attached due to + previous create_partition_id failed as YB does not support + transactional DDL. IF v_exists IS NOT NULL THEN CONTINUE; END IF; + */ -- Ensure analyze is run if a new partition is created. Otherwise if one isn't, will be false and analyze will be skipped v_analyze := TRUE; @@ -180,8 +209,10 @@ FOREACH v_id IN ARRAY p_partition_ids LOOP END IF; END IF; - RAISE DEBUG 'create_partition_id v_sql: %', v_sql; - EXECUTE v_sql; + IF v_exists IS NULL THEN + RAISE DEBUG 'create_partition_id v_sql: %', v_sql; + EXECUTE v_sql; + END IF; IF v_partition_type = 'native' THEN diff --git a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_time.sql b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_time.sql index 3dde5d3ec304..db8459ca45b9 100644 --- a/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_time.sql +++ b/src/postgres/third-party-extensions/pg_partman/sql/functions/create_partition_time.sql @@ -54,12 +54,28 @@ v_time timestamptz; v_partition_type text; v_unlogged char; v_year text; +yb_v_child_table record; +yb_v_child_tables text[] := '{}'; +yb_v_is_child_table_attached boolean; +yb_v_constraint_name text; BEGIN /* * Function to create a child table in a time-based partition set */ +-- Fetch child tables using pg_inherits +FOR yb_v_child_table IN + SELECT child.relname + FROM pg_inherits + JOIN pg_class parent ON pg_inherits.inhparent = parent.oid + JOIN pg_class child ON pg_inherits.inhrelid = child.oid + WHERE parent.relname = split_part(p_parent_table, '.', 2) +LOOP + -- Append each child table name to the array + yb_v_child_tables := array_append(yb_v_child_tables, yb_v_child_table.relname::text); +END LOOP; + SELECT partition_type , control , partition_interval @@ -158,6 +174,15 @@ FOREACH v_time IN ARRAY p_partition_times LOOP -- This suffix generation code is in partition_data_time() as well v_partition_suffix := to_char(v_time, v_datetime_string); v_partition_name := @extschema@.check_name_length(v_parent_tablename, v_partition_suffix, TRUE); + + -- YB: check if child table is already attached + yb_v_is_child_table_attached := v_partition_name = ANY(yb_v_child_tables); + IF yb_v_is_child_table_attached THEN + RAISE NOTICE 'Table % already attached', v_partition_name; + v_partition_created := true; + CONTINUE; + END IF; + -- Check if child exists. SELECT count(*) INTO v_exists FROM pg_catalog.pg_class c @@ -165,9 +190,14 @@ FOREACH v_time IN ARRAY p_partition_times LOOP WHERE n.nspname = v_parent_schema::name AND c.relname = v_partition_name::name; + /* YB: Don't continue whole loop iteration, there could be + case that child partition was created but not attached due to + previous create_partition_time failed as YB does not support + transactional DDL. IF v_exists > 0 THEN CONTINUE; END IF; + */ -- Ensure analyze is run if a new partition is created. Otherwise if one isn't, will be false and analyze will be skipped v_analyze := TRUE; @@ -229,9 +259,10 @@ FOREACH v_time IN ARRAY p_partition_times LOOP END IF; END IF; - RAISE DEBUG 'create_partition_time v_sql: %', v_sql; - EXECUTE v_sql; - + IF v_exists IS NULL THEN + RAISE DEBUG 'create_partition_time v_sql: %', v_sql; + EXECUTE v_sql; + END IF; IF v_partition_type = 'native' THEN @@ -284,13 +315,22 @@ FOREACH v_time IN ARRAY p_partition_times LOOP , EXTRACT('epoch' FROM v_partition_timestamp_end)::bigint * 1000000000); END IF; -- Create secondary, time-based constraint since native's constraint is already integer based - EXECUTE format('ALTER TABLE %I.%I ADD CONSTRAINT %I CHECK (%s >= %L AND %4$s < %6$L)' - , v_parent_schema - , v_partition_name - , v_partition_name||'_partition_check' - , v_partition_expression - , v_partition_timestamp_start - , v_partition_timestamp_end); + -- YB: Check if the constraint already exists + SELECT conname INTO yb_v_constraint_name + FROM pg_constraint + WHERE conname = v_partition_name||'_partition_check' + AND conrelid = (quote_ident(v_parent_schema) || '.' || quote_ident(v_partition_name))::regclass; + + -- YB: If the constraint does not exist, create it + IF yb_v_constraint_name IS NULL THEN + EXECUTE format('ALTER TABLE %I.%I ADD CONSTRAINT %I CHECK (%s >= %L AND %4$s < %6$L)' + , v_parent_schema + , v_partition_name + , v_partition_name||'_partition_check' + , v_partition_expression + , v_partition_timestamp_start + , v_partition_timestamp_end); + END IF; END IF; ELSE -- non-native From b0349fea3e012787d1bde286ea54831a1d74ab2b Mon Sep 17 00:00:00 2001 From: Subramanian Neelakantan Date: Tue, 23 Jul 2024 04:14:00 +0000 Subject: [PATCH 153/154] [PLAT-14710] update api doc for /session_info Summary: This should have been part of D36712, but was missed. So following up with another change to update the api doc. Test Plan: swaggerGen Reviewers: svarshney, #yba-api-review! Reviewed By: svarshney Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D36761 --- .../java/com/yugabyte/yw/controllers/SessionController.java | 4 +++- managed/src/main/resources/swagger-strict.json | 2 +- managed/src/main/resources/swagger.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java b/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java index 56d4343603b4..81e006bc4804 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/SessionController.java @@ -181,7 +181,9 @@ public static class SessionInfo { @ApiOperation( nickname = "getSessionInfo", - value = "Get current user/customer uuid auth/api token", + value = + "Get current user and customer uuid. This will not generate or return the API token, use" + + " /api_token API for that.", authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH), response = SessionInfo.class) @With(TokenAuthenticator.class) diff --git a/managed/src/main/resources/swagger-strict.json b/managed/src/main/resources/swagger-strict.json index 16253e0bd06f..7fb1f51d8f5d 100644 --- a/managed/src/main/resources/swagger-strict.json +++ b/managed/src/main/resources/swagger-strict.json @@ -28556,7 +28556,7 @@ "security" : [ { "apiKeyAuth" : [ ] } ], - "summary" : "Get current user/customer uuid auth/api token", + "summary" : "Get current user and customer uuid. This will not generate or return the API token, use /api_token API for that.", "tags" : [ "Session management" ] } }, diff --git a/managed/src/main/resources/swagger.json b/managed/src/main/resources/swagger.json index 96b94d4b3ab7..564a3235c85e 100644 --- a/managed/src/main/resources/swagger.json +++ b/managed/src/main/resources/swagger.json @@ -30018,7 +30018,7 @@ "security" : [ { "apiKeyAuth" : [ ] } ], - "summary" : "Get current user/customer uuid auth/api token", + "summary" : "Get current user and customer uuid. This will not generate or return the API token, use /api_token API for that.", "tags" : [ "Session management" ] } }, From fe37ffdb44473506691f4ec6e6faf8161e616058 Mon Sep 17 00:00:00 2001 From: Sumukh-Phalgaonkar Date: Tue, 23 Jul 2024 12:01:32 +0530 Subject: [PATCH 154/154] [#23240] CDCSDK: Make test replicationConnectionConsumptionAllDataTypes more resilient Summary: In the tests `TestPgReplicationSlot#replicationConnectionConsumptionAllDataTypesWithYbOutput` and `TestPgReplicationSlot#replicationConnectionConsumptionAllDataTypesWithPgOutput` we create a table with dynamic types. This means that the typeoid of such types is allocated at runtime. The tests assert on the relation message to check the type_oid of every column. This makes the tests fragile as any change in the Oids allotment will cause the test to fail. This diff makes these tests more robust by skipping the type_oid assertions for dynamic types. Jira: DB-12173 Test Plan: Jenkins: .*TestPgReplicationSlot.* Reviewers: siddharth.shah, stiwary Reviewed By: siddharth.shah Subscribers: ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36763 --- .../org/yb/pgsql/TestPgReplicationSlot.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java index 4fe714230623..24f9d6871daa 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgReplicationSlot.java @@ -1010,11 +1010,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910), PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912), // The Oids for columns below are not fixed. Changing the order of creation of - // objects (extensions, tables etc.) in the test will these Oids. - PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385), + // objects (extensions, tables etc.) in the test will change these Oids. Hence, + // skip comparing the Oids of these types. + PgOutputRelationMessageColumn.CreateForComparison( + "col_hstore", 16385, /* compareDataType */ false), PgOutputRelationMessageColumn.CreateForComparison( "col_discount", 16518, /* compareDataType */ false), - PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517)))); + PgOutputRelationMessageColumn.CreateForComparison( + "col_discount_array", 16517, /* compareDataType */ false)))); } else { // The replica identity for test_table in case of pgoutput is DEFAULT. add(PgOutputRelationMessage.CreateForComparison("public", "test_table", 'd', @@ -1054,11 +1057,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910), PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912), // The Oids for columns below are not fixed. Changing the order of creation of - // objects (extensions, tables etc.) in the test will these Oids. - PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385), + // objects (extensions, tables etc.) in the test will change these Oids. Hence, + // skip comparing the Oids of these types. + PgOutputRelationMessageColumn.CreateForComparison( + "col_hstore", 16385, /* compareDataType */ false), PgOutputRelationMessageColumn.CreateForComparison( "col_discount", 16518, /* compareDataType */ false), - PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517)))); + PgOutputRelationMessageColumn.CreateForComparison( + "col_discount_array", 16517, /* compareDataType */ false)))); } add(PgOutputInsertMessage.CreateForComparison(new PgOutputMessageTuple((short) 38, Arrays.asList(new PgOutputMessageTupleColumnValue("1"),