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 1wcYRD-003Rfk-2Y for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2026 00:59:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcYRC-003AU1-26 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2026 00:59:26 +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 1wcYRC-003ATt-1B for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2026 00:59:26 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcYRA-000000006dU-1TCL for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2026 00:59:25 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-8dea42b5497so19245486d6.1 for ; Wed, 24 Jun 2026 17:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782349163; cv=none; d=google.com; s=arc-20260327; b=ONTAswKcxIACRBEhUvhMABKsu0YR/uxdW+5F2i2tK8UFwHcpzsxubwu0csY1DLr9p/ HxbrcIt5+bUDEZ7adUejldTTDftmkKMtbSw3LzoEypJK4Pb5BBa6T+DH33DPvUexavxU hcVTEVA+GeiEbrayBdRxUb1+s0Kwtxq3iR3Q3XVRA5upYvKP1fSMZNTdIVIoa79w7jg7 Vd5Au8Wavj48p2znF1feC9OkASXJ9dzw5AsAHOX/sla7U58jhpfsk+XHPkiP8bV45alT Onn+iGezRZLUhMj6hoV64d/14qK1b4M1RlcH51QdvZCYdHXQssUBJ7EFiarUAorDh3fZ q5Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=le8jRPLhciD/UG+Ostwdx3iE3BVmDDrAD2CNddt4+B8=; fh=PnOk7+UDmJ4DVUtTV3E3M3h9qbJswshMAk3PCMo9qiU=; b=KJdDrRV54hY1/5Szz35c2RGC3vUko9X7K35GZvAMKuRoz2gMQVDfIFHJbxQzM/LoUd AaUJZJSFSLo3afJJrpoXgWEuSEYt0Wtremo0IDVGewSimctlsZrl9Sgr7RiPb9l0tYtu jH0EDcIE5TGPV6946a9ZAnbPDEv1yFtEwy8HSMyWWW8saK++z2Un60+2iPBO9Ree4pYF 4Rh9dBINZ7XtiIXvttNRUNcVg5E/fm+fI+r7cgGbSmNbbBtBegWGFvvccuN3dKyDf88V LecYTIpl65sMDGHtzPFsa3aXJ1hoOZAb76NFCL+Qa18hWZuc6o/nULo7VqvyUHne7Iy6 jH7A==; 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=1782349163; x=1782953963; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=le8jRPLhciD/UG+Ostwdx3iE3BVmDDrAD2CNddt4+B8=; b=OmrWJ1WnuIqRyWKbOdwGZOMO/GOyuxcRn6yBy6aJ+8gGCM/ufykfYVoOtmbyKfS1bn GqwDcJn+dTP5PQJZM93Wo0AgnKQvAK/MpBJgSEqpt9nJ/mm/YwXRWODRjyg2dlUly5Xp jdP15aqBS9zB0Lowxkc5q9IbSyaGe1BQ0pmdnMEjFlNyXg33h/QDf5kLeXz0k/HIn0Wo nNIdOhOHf0J1EYaHw2CnA+/7CWj6Hf2bWLe6W+lyh7Yg1bSNMlgjrWdTmlTdhUGUJqp2 nxkrzRsD0FoUJD5uUmk5qFKcwe4bUsyrw7oF7WwGp7J02YIdCStNQFDUrQUXBj6iJJq7 jh+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782349163; x=1782953963; h=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=le8jRPLhciD/UG+Ostwdx3iE3BVmDDrAD2CNddt4+B8=; b=pJl2Ah1AvkmUM/wRxGySwcTb+wTM9gsNo8go8pPMp61HOKzNqwDSePkxOU8xeeyN8b n18st2EkAD/M6aGyiYeRqPZW7PkmqWOoJIUHaZtMNwH/ymbNaBLDEPdUw/+JavmT1BzL zKHNRs0sn0qPbNFYcPROb78wyxS5wZ/APdLN9CBx/Qw7xAhx/cdm8HLwDR5/wJ1ESwds qckIgxzPk/fBFBQl+cSEeQiwA5L6AWo+RNYFJO5Qa6Dh1ARrCSQ2Cb5oZ7L3o+SS62pj oO72C/ehVfuwksqf6CUcCtrfe4rUpID2MAi68xQJiUy8GKirTf+9qR1R+0mYqALAIeV+ cOKg== X-Gm-Message-State: AOJu0Yx3ETtDxIeMC4h9M43mcsaZIk7iRMGAGTP4Ps2KUAAPaZZ9tMgM 7rgjntik/pACKyzccO+pZli8iqg+DmXv53KSkPR3I+8xaDNZabpcuAWr1GGotwb3ElVTn2ommXj Q7i/69Ha7U7U248zAZysPRtrBQze9tmi4TXHv X-Gm-Gg: AfdE7cnDuoNUN++w5Satb84FVIcHzp5RDrUG+sbcrZiodGa6iR6P1XXBc5Xi1pyz/sw 94jD28i4axaE6Zr6BoLK6kHKZgFN3VhqcKb1aRwLiaYpTUHXZq1Jw2V+46Uw/T+2kMDEjcZfDWH 6mQoDf1GwFQpE0jdxcSB8mmPaY9GKt/BUqDv/qNEZ1hlq5HUqFQr1HukX6rpEnPF7Ifh0D5zGn9 zE31b7/yMNXyiir03rDDg7aE2UuEQtZ0jKbwZ3hfSWYrFQ54BS3+yX9ve445bIngexZANdpMQ== X-Received: by 2002:a05:622a:1f85:b0:517:90d2:598b with SMTP id d75a77b69052e-51a72a5619amr3913041cf.39.1782349163422; Wed, 24 Jun 2026 17:59:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Thu, 25 Jun 2026 12:58:57 +1200 X-Gm-Features: AVVi8Cf4-BADRuqpo89EdZhVNJehpr5Oj2y_HTxE1tNA2v3JKUFNgPO_yhENWsI 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" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Vignesh. Some comments for v2. ====== doc/src/sgml/ref/pg_createsubscriber.sgml 1. fresh logical replication setup. The main difference between the logical replication setup and pg_createsubscriber is how the data synchronization is done. pg_createsubscriber - 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. 1a. OK. Thanks for the explanation on what was meant. Personally, I found the wording "sequence is brought up to a synchronized state" ambiguous, because in my mind the sequence value is a part of the sequence state. Below is some alternate wording for consideration: SUGGESTION: pg_createsubscriber performs only the synchronization phase, which prepares each table and sequence for replication. It does not copy table data or synchronize sequence values from the publisher. ~~~ 1b. While reviewing this patch I also referred to section "29.7. Replicating Sequences #". [1] for more information. But there I was tricked by some (misleading?) wording. I have created another thread [2] to discuss/patch that. Please see it and post your thoughts. ~~~ 2. + + Note that although the publication includes sequences, sequence value + changes made on the publisher after reaching consistent point are not + synchronized incrementally. To synchronize sequence values, run + + ALTER SUBSCRIPTION ... REFRESH SEQUENCES, which + fetches the current sequence state from the publisher and advances the + corresponding subscriber sequences. I wonder if the last sentence is overly descriptive. Isn't it enough to just say: To synchronize sequence values, run ALTER SUBSCRIPTION ... REFRESH SEQUENCES. ~~~ 3. Enable the subscription for each specified database on the target server. The subscription starts applying transactions from the replication start - point. + point. The subscription is configured to include sequences. This implies there was some special subscription "configuration" for getting sequences, but it just gets sequences because sequences were published. Maybe you don't need to say anything here. Or, maybe reword to just say "The subscription will include sequences". ====== [1] https://www.postgresql.org/docs/19/logical-replication-sequences.html#LOGICAL-REPLICATION-SEQUENCES [2] https://www.postgresql.org/message-id/CAHut%2BPsrVntfrJ8gV45%2B6%3D1bs5dTWD5mU7Q6aKrBnf1vmyZQkQ%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia