Re: Logical Replication of sequences
От | Dilip Kumar |
---|---|
Тема | Re: Logical Replication of sequences |
Дата | |
Msg-id | CAFiTN-t3cMXmADYENcbTwYo2n6AQN4Qy0ZEKepnMp7qxKGD0vw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Logical Replication of sequences (Amit Kapila <amit.kapila16@gmail.com>) |
Список | 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;
+ 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);
+ 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 по дате отправления: