On 23.02.22 00:24, Tomas Vondra wrote:
Here's an updated version of the patch, fixing most of the issues from
reviews so far. There's still a couple FIXME comments, but I think those
are minor and/or straightforward to deal with.

This patch needs a rebase because of a conflict in expected/publication.out. In addition, see the attached fixup patch to get the pg_dump tests passing (and some other stuff).

028_sequences.pl should be renamed to 029, since there is now another 028.

In psql, the output of \dRp and \dRp+ is inconsistent.  The former shows

All tables | All sequences | Inserts | Updates | Deletes | Truncates | Sequences | Via root

the latter shows

All tables | All sequences | Inserts | Updates | Deletes | Sequences | Truncates | Via root

I think the first order is the best one.

That's all for now, I'll come back with more reviewing later.
From 43b0aa50d621f3b640e4285e4e329c361988a6c4 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Thu, 10 Mar 2022 12:02:56 +0100
Subject: [PATCH] fixup! Add support for decoding sequences to built-in
 replication

---
 src/bin/pg_dump/t/002_pg_dump.pl         | 2 +-
 src/interfaces/libpq/fe-exec.c           | 9 ---------
 src/test/subscription/t/028_sequences.pl | 5 ++---
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 14b89c62f7..1bcd845254 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -2398,7 +2398,7 @@
                create_order => 50,
                create_sql   => 'CREATE PUBLICATION pub4;',
                regexp => qr/^
-                       \QCREATE PUBLICATION pub4 WITH (publish = 'insert, 
update, delete, truncate');\E
+                       \QCREATE PUBLICATION pub4 WITH (publish = 'insert, 
update, delete, truncate, sequence');\E
                        /xm,
                like => { %full_runs, section_post_data => 1, },
        },
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 2b81065c47..0c39bc9abf 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -3733,10 +3733,7 @@ char *
 PQgetvalue(const PGresult *res, int tup_num, int field_num)
 {
        if (!check_tuple_field_number(res, tup_num, field_num))
-       {
-               printf("getvalue\n");
                return NULL;
-       }
        return res->tuples[tup_num][field_num].value;
 }
 
@@ -3747,10 +3744,7 @@ int
 PQgetlength(const PGresult *res, int tup_num, int field_num)
 {
        if (!check_tuple_field_number(res, tup_num, field_num))
-       {
-               printf("getlength\n");
                return 0;
-       }
        if (res->tuples[tup_num][field_num].len != NULL_LEN)
                return res->tuples[tup_num][field_num].len;
        else
@@ -3764,10 +3758,7 @@ int
 PQgetisnull(const PGresult *res, int tup_num, int field_num)
 {
        if (!check_tuple_field_number(res, tup_num, field_num))
-       {
-               printf("getisnull\n");
                return 1;                               /* pretend it is null */
-       }
        if (res->tuples[tup_num][field_num].len == NULL_LEN)
                return 1;
        else
diff --git a/src/test/subscription/t/028_sequences.pl 
b/src/test/subscription/t/028_sequences.pl
index 3843440946..cdd7f7f344 100644
--- a/src/test/subscription/t/028_sequences.pl
+++ b/src/test/subscription/t/028_sequences.pl
@@ -6,7 +6,7 @@
 use warnings;
 use PostgreSQL::Test::Cluster;
 use PostgreSQL::Test::Utils;
-use Test::More tests => 6;
+use Test::More;
 
 # Initialize publisher node
 my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -199,5 +199,4 @@
        'check replicated sequence values on subscriber');
 
 
-$node_subscriber->stop('fast');
-$node_publisher->stop('fast');
+done_testing();
-- 
2.35.1

Reply via email to