Re: Logical Replication of sequences - Mailing list pgsql-hackers

From vignesh C
Subject Re: Logical Replication of sequences
Date
Msg-id CALDaNm0Aw7uQWBDT6sL-G8rpyvAoZfn3FjqjwjG6+HXMoexFcQ@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On Mon, 8 Sept 2025 at 12:05, Chao Li <li.evan.chao@gmail.com> wrote:
>
>
>
> On Sep 8, 2025, at 14:00, vignesh C <vignesh21@gmail.com> wrote:
>
>
>
> 1 - 0001
> ```
> diff --git a/src/test/regress/sql/sequence.sql b/src/test/regress/sql/sequence.sql
> index 2c220b60749..c8adddbfa31 100644
> --- a/src/test/regress/sql/sequence.sql
> +++ b/src/test/regress/sql/sequence.sql
> @@ -414,6 +414,6 @@ SELECT nextval('test_seq1');
> SELECT nextval('test_seq1');
>
> -- pg_get_sequence_data
> -SELECT * FROM pg_get_sequence_data('test_seq1');
> +SELECT last_value, is_called, log_cnt, page_lsn <= pg_current_wal_lsn() as lsn FROM
pg_get_sequence_data('test_seq1');
>
> DROP SEQUENCE test_seq1;
> ```
>
> As it shows log_cnt now, after calling pg_get_sequence_data(), I suggest add 8 nextval(), so that sequence goes to
11,and log_cnt should become to 22. 
>
>
> Could you please explain the reason you’d like this to be done?
>
>
> Because log_cnt is newly exposed, we want to verify its value in the test. When I first time ran the test code, I saw
initialvalue of log_cnt was 32, then I thought log_cnt might get decreased if I ran nextval() again, but it didn’t.
Onlyafter I ran 10 (cache size) more nextval(), log_cnt got decreased by 10 to 22. The test code is a place for people
tolook for expected behavior. So I think adding more nextval() to verify and show the change of log_cnt is helpful. 

Thanks, I will include this in the next version.

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Next
From: Amit Kapila
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart