Re: [PATCH] Report changes discarded for relations not in the subscription

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Report changes discarded for relations not in the subscription
Date: 2026-12-01 21:34:38
Message-ID: CAHut+PtXcE=ruc2098v=MYu5zA6149=En+0HJXV26Q6dzWMrvw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 2, 2026 at 3:16 AM Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com> wrote:
>
> Hi Peter,
>
> Thanks for the review. v5 is attached. It changes only the tests.
>

Thanks for updates!

>
> > 3.
> > I wonder if it's more readable to not have that loop, and simply do:
> >
> > $node_publisher->safe_psql('postgres', qq(
> > INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> > INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> > INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> > ));
>
> I'd prefer to keep the loop. The point of this test is that there are
> three separate streamed transactions, each sending the RELATION message
> again. The loop makes it explicit that each INSERT is its own
> safe_psql() call and so its own transaction. A single script relies on
> psql's autocommit to split it into three transactions, and that's less
> obvious to the reader. The result is the same either way, so I can change
> it if you feel strongly.
>

Keeping the loop is fine; your reason makes sense.

1.
But here are some minor nits.
a/ The comment says "Each is large enough to be streamed..." -- each what?
b/ That $i is not really needed, so I'd remove it.

SUGESTION
# Each INSERT is a separate transaction, large enough to be streamed given
# logical_decoding_work_mem = 64kB.
foreach (1 .. 3)
{
$node_publisher->safe_psql('postgres',
"INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000)");
}

~~~~

2.
+# Large enough to be streamed, given logical_decoding_work_mem = 64kB.
+$node_publisher->safe_psql('postgres',
+ "INSERT INTO test_tab_3 SELECT i FROM generate_series(1, 5000) s(i)");
+

Same nits for this fragment.
a/ "Large enough" -- what is?
b/ Has unnecessary i.

SUGGESTION
# This INSERT is large enough to be streamed, given
logical_decoding_work_mem = 64kB.
$node_publisher->safe_psql('postgres',
"INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000)");

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Zsolt Parragi 2026-12-01 21:18:01 Re: [PATCH] pgcrypto: Fix sha-crypt rounds= values that do not fit in int (BUG #19743)