Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbpYR-002sSU-2b for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 01:03:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbpYO-008jtf-2u for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 01:03:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbpYO-008jtX-1R for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 01:03:52 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wbpYM-00000001fTi-36un for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 01:03:51 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-9157f7c1c0eso476494185a.1 for ; Mon, 22 Jun 2026 18:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782176629; cv=none; d=google.com; s=arc-20240605; b=PuRVnI+L2AUU5J4DKmUKnhthA/se4V6KneIaH/DixUpmJGxX+4vxs0f7yR7phSj/rO TkrnhY9wmvPGAUTTIk5MOBaCpG2dnChVASfxiRuqKzyDvCIpTGNjkkuH1dBWkOl9uqZ7 bFEusDGUdhLICRpWQ3b9gMrFT1tCV0xyU3NuVln+DDV/xftVQzKt5uuD0OG+N4V5f4ix bt9aYrqv9WY8CAL77nTmxGfhgSMvjA52LIZi5qLRItXHa0fZEwJZPs+HUannxX2d0hvr Ya4eNWT6MR3kikviStxLVh8y8AgFBkhmClhGNCovKDVRX/dNV5WvRioWdcTYAzo3sHIM qGhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WQE1XIBPy27+0HMqaYZWE//FtCBP4Ki5+B4kQRGRh6E=; fh=PnOk7+UDmJ4DVUtTV3E3M3h9qbJswshMAk3PCMo9qiU=; b=FdSrG6WtV31ZgXwbhRO2KicSkyDHVLvBrC5h/wYXsxbHHCAX7fe7WbIurFMtMCaGD7 +YlVyRpFGFNDGleWu91yqxJisfE0tavTf3G3Z8gehiYz7PlILkhoEDhs8qQTw7338Coy 8MvPN8tyh4kYf8eg/n9LX/r9Oa576Azxj0hRBk8AG7mmAGWJ3QS5UR8XG9srC6VkidTG yX3CJ0whKJ51ykfaDKX6uklS8/HnVKir/qrJDHtORG9ZQVHHd4Y++VJRCgtnxailqKqf gDJB78mkiFZHfp4995rYAJceZbMIcNM49WLdGQQ38cmV4/FOEwkn/f/+GBFoS144ZrZa gz0Q==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782176629; x=1782781429; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WQE1XIBPy27+0HMqaYZWE//FtCBP4Ki5+B4kQRGRh6E=; b=coyQkagD/JRgwAFU8T5Mb5+pUxoQu2xwz9OA6KPD1T17Gb6vyWLrKeDib0l4+WBuMx e06qzA0XOrcIc0Kipt4GigmznsLK2HhY756PVRzScNBNbTt/cdpMOakU1S8R+uriQLaf 5GlsY2G1xd5OYt6kQkGcVAGuTo4Ycgyvp/euSxnAF8oOMN6Z4PgSyJzS1RLhVO9fUHEk PUm1cx12GOcs0pBNvk8egFxA8xww/9vfHgsmrFNkGnKlku/6hPKUDw68UX6/sGgSiHG4 /01t89bKj41ZQZGvUD1Xp0C7iV+gtw3kdwb0fBSSr3hiIqBXiTIC6w40XThHV1voNTdQ 6ebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782176629; x=1782781429; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WQE1XIBPy27+0HMqaYZWE//FtCBP4Ki5+B4kQRGRh6E=; b=Gc4YwGjgSxNMxCI7Lmcw5Em3abaSPzV3aloBngL9eD5ZCsvmjVIIZld+F/SLulhiAO qHREX6jY1/Y8x8Mrzh6HixB94a5leE52lYkZ5LSn8gdEASuyhYveQO6CNFoPi8/0fvV9 s9pA5wn8xJknddcLUYB25lmakDpOG/NHWZejI42Aj/FpXRVieWUtrkLsYIyXT5+0wgCb OJfNVLeZw6O8MqXYQEcbUw3V2JrisYpikvgPYDLw+Gzq+pVZsORE0So2xRPqMOvqyoSq oQQtHyOCjB52DiQAcvI8KCBOEZxAFoWZjC+HRyOO5YCVRg3GsieD5KbAi/ufWrQemvGO SiUw== X-Gm-Message-State: AOJu0Yy377fTM9PTMn+IwMoMvXNMS+T5rsSZjBqXWFAcPqjlYk1GRJXE RiR5rpYFWPzdgU/iQJXL0FxEXzFnO4Tcpyq26SlUlKM1W0gfwqwNYky93Mp/aAmAq1bHFgLuCtM AaBKx/UpGc9yq05RkT70z9ddsj2XXidCa4wpl X-Gm-Gg: AfdE7cnJdVsIzmfeNzSzOhOnB0lT1FTuXfcRszVa4ZVaZYlpeoK6n7gIOEb/CsRGh8L 4Ef/NDN8MZAgbTpe+r/4EKfAAdHmkxRBAUa8bod6LJsOLKiMNPOTTFsgmbBdWrGwxs7kIAkNnkb j4WLlfWcCBE7cbZUXfFPe7hUU/wuaZFgBWfhH0If9PxXVsZWiYmLeNLjjgRkkEmeLKMlknRgQhI 0OqpPy13pLCpdSeY8FgwuB8QC3b5CgEXfw5BTTmPzK5DfsKQtJD+XJRIrMCf+U+4p+Q1EDGUU0= X-Received: by 2002:a05:622a:120e:b0:519:8988:b107 with SMTP id d75a77b69052e-519e4913f27mr257846991cf.6.1782176629232; Mon, 22 Jun 2026 18:03:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Tue, 23 Jun 2026 13:03:23 +1200 X-Gm-Features: AVVi8CdS5IFACS2HfLLkxsc9rMGvEaaGO5z_1c4uAcu9A_BUdlnO-0QDW6XdTGw Message-ID: Subject: Re: Include sequences in publications created by pg_createsubscriber To: vignesh C Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jun 20, 2026 at 1:59=E2=80=AFAM vignesh C wro= te: ... > The attached patch modifies pg_createsubscriber to include sequences > in the publication it creates, enabling this workflow. > Thoughts? > Hi Vignesh, +1 to make this change. Some review comments for patch 0001. =3D=3D=3D=3D=3D=3D Commit Message 1. This change modifies pg_createsubscriber to include all sequences in the publication it creates. Administrators can then run ALTER SUBSCRIPTION ... REFRESH SEQUENCES after the upgrade to synchronize sequence state, ensuring a more complete and reliable upgrade workflow. ~ /include all sequences/include ALL SEQUENCES/ =3D=3D=3D=3D=3D=3D doc/src/sgml/ref/pg_createsubscriber.sgml 2. - does not copy the initial table data. It does only the synchronization phase, - which ensures each table is brought up to a synchronized state. + does not copy the initial table or sequence data. It does only the + synchronization phase, which ensures each table and sequence is brought= up + to a synchronized state. I felt "does not copy the initial [...] sequence data" should not be said for sequences. AFAIK each sequence has only 1 value anyway, so bringing it "to a synchronized state" is effectively the same thing as copying the initial data for sequences, so saying in the first sentence that copy does not happen seems a contradiction. IIUC what above means is really just the same as chapter 29.7, which says "use CREATE SUBSCRIPTION to initially synchronize the published sequences.". ~~~ 3. linkend=3D"sql-createpublication-params-for-all-tables">FOR= ALL - TABLES. If the opti= on + TABLES and = FOR ALL + SEQUENCES. If the o= ption is not specified, the publication has the following name pattern: Maybe just say "ALL SEQUENCES" here instead of "FOR ALL SEQUENCES"? ~~~ 4. Enable the subscription for each specified database on the target se= rver. The subscription starts applying transactions from the replication s= tart - point. + point. The subscription is configured to include sequences. Sequence + values can be synchronized at any time by running + + ALTER SUBSCRIPTION ... REFRESH SEQUENCES, = which + fetches the current sequence state from the publisher and advances t= he + corresponding subscriber sequences. IIUC, all this "How it works" section is describing the internal logic of what pg_subscriber is internally. OTOH, this "REFRESH SEQUENCES" is just a note about what the Administrator can do manually later... So, maybe you can still write this note somewhere, but just don't include it buried in the internal "How it works" steps. =3D=3D=3D=3D=3D=3D src/bin/pg_basebackup/pg_createsubscriber.c 5. Patch needs also to update the function comment for create_publication() because currently it still says "includes all tables". =3D=3D=3D=3D=3D=3D Kind Regards, Peter Smith. Fujitsu Australia