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.94.2) (envelope-from ) id 1tqddB-008AwA-F4 for pgsql-general@arkaria.postgresql.org; Fri, 07 Mar 2025 19:45:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqddA-00G33C-6Z for pgsql-general@arkaria.postgresql.org; Fri, 07 Mar 2025 19:45:12 +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.94.2) (envelope-from ) id 1tqZaS-008R37-BR for pgsql-general@lists.postgresql.org; Fri, 07 Mar 2025 15:26:08 +0000 Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqZaQ-001Vu8-1F for pgsql-general@postgresql.org; Fri, 07 Mar 2025 15:26:07 +0000 Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-e53a91756e5so1601899276.1 for ; Fri, 07 Mar 2025 07:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741361165; x=1741965965; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=VsVFnZh6s8nyDS5/2c2Q8ZZtJDOk0AKfLcgPBdMgfYs=; b=mzZtQ0aW4sF545wZ94RxZKvvTdldXPGUzD55KLeuQt9260G2DsA4CxoC+7vh4brxAV mKWAgBphFiQP6IzVXKsHpoE5sRV/f9T4FnrmxqDX/D7oyVcyNDDaBzBYDhV4Pu+6oO6A al7HmlVqNbSPlG2zvzTKLmMQp/vV52WR20bxfVa3Yz2fcPVHNN6nMu9un0pC1g7ClT31 c910oil5E3aVzqIC44yXcNxN1AvnIOsgqaCyx+otN3fpRFqLbcfNqA3J8/a7bi4X+1bg 8h3x0i8swfezq7TPbX8qcBRbjQOlWjyVsFSTc6sHpP8o4ab7JR+k6pIrgFnwr0OXCTP+ MAcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741361165; x=1741965965; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VsVFnZh6s8nyDS5/2c2Q8ZZtJDOk0AKfLcgPBdMgfYs=; b=rhDO+nDF8alsBKWQ0rhsgJqajrF2YNzyTmuovPZuc3tE6/UrtTKSFk7F6flpUjQhii F4SMwSomDzxlM/rtoBRphbb2GCW6on+pwTVTibE+vEHleMl2YRAtoI8zTmz4mSjpItCW uifcBV6S+L+/11fV3T+SkeBB3Pr+bsYReJVxT0QfwMu8/zQ3JEp0Zm3S8os+VtCSzeN2 Wr1j2mzQN6YZBkEzQ/VIWbx0uJ+9KsUVsVCdtIQ83BIZpyIRs/mLvpNT3Yzu796CFzoM hmXo2L15UShv1Hzu3Taef8rw4c0fUSn6yisTRv3krThgt01tlahqm0zL3cqoKFWkrBCV jrug== X-Gm-Message-State: AOJu0YyfEN7RO9MMwRrcVPKaiaLQ4mxJ4ZI2eqBCiHguIFUneHgb8xZY hJSZVQ9FFtNgQW0GLlsl6rnPyHa7EhFuObP5LPWdruu2v4W1ysFsR6n3sUkdI47BtCE8f4iLVsC Vbxr3Nuk8wu2gfudQLNYdstlnIt9zZwUTPtE= X-Gm-Gg: ASbGncvDeQWHz7eKJsDj/gkdogjZsvQxROHGJ8hYJH2irnI6Cechbgou/o3eLoAG+7f qxjhBC6BpJkiUVQ4RA8ASEPXQxppUXgQ7VgST8n0B3DZWQC7dZ6rw6kZpy0aGubz+27MgSdCmZF Srdcr/J/v8VflgO6l6faYKvuPTaAw= X-Google-Smtp-Source: AGHT+IFmuq6A3Q5Xfw3W/ePXwJ6Dl68I1YEhOVsJJ3iQN3rhoSxxyTSbSsQ/hqLcck/3S4JAIpM/J3ilsLkwIeVCRn0= X-Received: by 2002:a05:6902:3401:b0:e5d:cdc6:7ad3 with SMTP id 3f1490d57ef6-e635c1db9d0mr4600505276.41.1741361165493; Fri, 07 Mar 2025 07:26:05 -0800 (PST) MIME-Version: 1.0 From: Atapys Sharsh Date: Fri, 7 Mar 2025 15:25:54 +0000 X-Gm-Features: AQ5f1JqG4EFwh6jbywHNdNyziKHBSJiT9ndEDDYSTuv4b0hK6qpNIrs9ywqlRtY Message-ID: Subject: Changing column filter for existing publication with WAL backlog To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000b1f996062fc23de5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b1f996062fc23de5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Recently, I decided to add column filtering for our publication. The commands I used were: ALTER SUBSCRIPTION mysub DISABLE; ALTER PUBLICATION mypub SET TABLE public.my_table(id, first_column, another_column), TABLE public.other_table; -- excluding third_column ALTER SUBSCRIPTION mysub ENABLE; When I tested this approach in our staging environment, it worked as expected =E2=80=93 I stopped seeing updates to third_column. However, in pr= oduction I still see updates to that column. I also ran ALTER SUBSCRIPTION mysub REFRESH PUBLICATION after noticing that updates were still being replicated= . Could this behavior be due to the large WAL backlog in production? At the time I applied the column filter, the replication lag was around 4 TB (with total storage being 16 TB). Should I expect that once production catches up to WAL records generated after the change, updates to third_column will eventually stop replicating? Thanks in advance for your help. --000000000000b1f996062fc23de5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,

Recently, I decided to add column filtering f= or our publication. The commands I used were:
ALTER SUBSCRIPTION mysub DISABLE;

ALTER PUBLICATION mypub <= span class=3D"gmail-hljs-keyword">SET TABLE public.my_table(id, first_column, another_column), TABLE public.other_table;=C2=A0-- excluding third_column

ALTER SUBSCRIPTION mysub ENABLE;

<= p>When I tested this approach in our staging environment, it worked as expe= cted =E2=80=93 I stopped seeing updates to third_column. Howev= er, in production I still see updates to that column. I also ran ALTE= R SUBSCRIPTION mysub REFRESH PUBLICATION=C2=A0after noticing that up= dates were still being replicated.

Could this behavior be due to the = large WAL backlog in production? At the time I applied the column filter, t= he replication lag was around 4 TB (with total storage being 16 TB). Should= I expect that once production catches up to WAL records generated after th= e change, updates to third_column will eventually stop replica= ting?

Thanks in advance for your help.

--000000000000b1f996062fc23de5--