Re: Logical Replication of sequences

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Subject: Re: Logical Replication of sequences
Date: 2025-10-14 11:37:46
Message-ID: CAFiTN-t3cMXmADYENcbTwYo2n6AQN4Qy0ZEKepnMp7qxKGD0vw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 14, 2025 at 3:36 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

0001 and 0002 looks good, except this duplicate version checking code below
in fetch_relation_list [1][2], I mean check_relkind and sequence fetching
both are related changes and start from version 19, so we can do a single
check. Instead of the 'check_relkind' variable name we can change it to
'support_relkind_seq' or something like that and then we can use this in
both checks.

[1]
+ bool check_relkind = (server_version >= 190000);
+ int column_count = check_columnlist ? (check_relkind ? 4 : 3) : 2;

[2]
+ /* From version 19, inclusion of sequences in the target is supported */
+ if (server_version >= 190000)
+ appendStringInfo(&cmd,
+ "UNION ALL\n"
+ " SELECT DISTINCT s.schemaname, s.sequencename, NULL::int2vector AS
attrs, " CppAsString2(RELKIND_SEQUENCE) "::\"char\" AS relkind\n"
+ " FROM pg_catalog.pg_publication_sequences s\n"
+ " WHERE s.pubname IN (%s)",
+ pub_names->data);

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-10-14 12:09:16 RE: Logical Replication of sequences
Previous Message David Rowley 2025-10-14 11:31:36 Re: A tidyup of pathkeys.c