RE: Logical Replication of sequences
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, 'vignesh C' <vignesh21@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>, shveta malik <shveta.malik@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, Chao Li <li.evan.chao@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Nisha
Moond <nisha.moond412@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Euler Taveira <euler@eulerto.com>, Michael Paquier <michael@paquier.xyz>, "Jonathan S.
Katz" <jkatz@postgresql.org>
Date: 2025-10-14T12:09:16Z
Lists: pgsql-hackers
Dear Hou,
Thanks for updating the patch. Here are comments for recent 0002.
Others are still being reviewed
01. pg_subscription_rel.h
```
+#include "nodes/primnodes.h"
```
The inclusion is not needed because the
02. typedefs.list
```
+SubscriptionRelKind
```
Missing update.
03. subscritioncmds.c
```
+#include "catalog/pg_sequence.h"
```
I could build without the inclusion. Can you remove?
04. check_publications_origin
```
+
+ query = "SELECT DISTINCT P.pubname AS pubname\n"
+ "FROM pg_publication P,\n"
+ " LATERAL %s GPR\n"
...
```
pgindent does not like the notation. How aboout chaning the line after the "="?
I.e.,
```
query =
"SELECT DISTINCT P.pubname AS pubname\n"
"FROM pg_publication P,\n"
" LATERAL %s GPR\n"
...
```
05. AddSubscriptionRelState
```
if (HeapTupleIsValid(tup))
elog(ERROR, "subscription table %u in subscription %u already exists",
relid, subid);
```
Theoretically subid might be the sequence, right? Should we say "relation"
instead of "table" as well?
06. AlterSubscription_refresh_seq
```
+ /* Get local relation list. */
```
In contrast can we say "sequence"?
07. check_publications_origin
```
if (res->status != WALRCV_OK_TUPLES)
ereport(ERROR,
(errcode(ERRCODE_CONNECTION_FAILURE),
errmsg("could not receive list of replicated tables from the publisher: %s",
res->err)));
```
Should we say "relations" instead of "tables"? Similar lines are:
```
/* Process tables. */
...
* Log a warning if the publisher has subscribed to the same table from
```
Best regards,
Hayato Kuroda
FUJITSU LIMITED