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

From Dilip Kumar
Subject Re: Logical Replication of sequences
Date
Msg-id CAFiTN-t3cMXmADYENcbTwYo2n6AQN4Qy0ZEKepnMp7qxKGD0vw@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Tue, Oct 14, 2025 at 3:36 PM Amit Kapila <amit.kapila16@gmail.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

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: A tidyup of pathkeys.c
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Logical Replication of sequences