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 1uclJt-00GoWY-ET for pgsql-general@arkaria.postgresql.org; Fri, 18 Jul 2025 13:40: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 1uclJr-00CiHn-G5 for pgsql-general@arkaria.postgresql.org; Fri, 18 Jul 2025 13:40: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 1uclJr-00CiHf-4n for pgsql-general@lists.postgresql.org; Fri, 18 Jul 2025 13:40:11 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uclJq-007xCc-0Q for pgsql-general@lists.postgresql.org; Fri, 18 Jul 2025 13:40:10 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3ab112dea41so1243715f8f.1 for ; Fri, 18 Jul 2025 06:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752846007; x=1753450807; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=CBSayBX99+4QoBaUncMOEYIyhrcHPR7/iR3R/OpkdBw=; b=BOfvHdVWrLuA7SzvlVDhI9GRB/amKD04Dph7gyHDsTqbrLvGIaRhrE+f10yA4v2b9I iHwdr3aSg0vgGvHSJpt81d/1Nz8Wcatd+6dUYQMkY/GZcAClat8RZML+Nc3EakpA2vQU 6XuSeyz8y2tSPek4guvv/hqWitD9u3ZjuNOUD5DYbO7k9tdL0uflZYLHnogaG8nZEwHY KiDcNh98ZsQuAfYqO6aJV1YrXrauKopgO6tPNN5Mxt8CzoU+qVwQh4VDRmpG8gXQlpNa K4dI8YJqN0RPf1bOKQ/tnJFRoQmV1UyDtzZk6uXvZYtwY4qEAFpvabkEAkdDaTK7DhCu I6mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752846007; x=1753450807; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CBSayBX99+4QoBaUncMOEYIyhrcHPR7/iR3R/OpkdBw=; b=a0fxT0o1vNG/3IvwkRDN1I3RThxzOldZPIlpMU4dzC350lxHVXZhaf0MnavTXQA8J4 H0o5XQbwu6isaVqljuBMwHgySQy/e/N5Xje21GBK7g+7us7+AnO0qrMoihc1l1DN+iqX QHF+wd1CIT4/jwOq1sboEVTYYLdw9tNMq0C/ekSH3P2/IjT7xWb8SFNimDtQ9xcjCPUU 79TJi+X2vzpH2r38j5M/sMwUrDJYRm3vgd8GGgrp2mboq0FyjnbH72CRsEE91g7Z9VWg aWe6yfELxIJjjEKvERZVin1B6b5WMFHO+GVtUPwgzyYYq9gzh518nO4vWRsRrMstJurg d5RA== X-Forwarded-Encrypted: i=1; AJvYcCWOZ4U3R/6qnbmXT6pzOkDPEcDkwCgPevAJsz6ztwAnaIsckYArSE5iy/I2S85Ka/TRNGSm2u6QOO6CSRWZ@lists.postgresql.org X-Gm-Message-State: AOJu0YyMqVyTp6tabBcekurX2bfelcbK4awBjU6w2FbHyJiILzOH0DlU +NoYSk3KIagJ8TFe1h/E+UTWQ/fzARau0idy5E5colu+JZaSHzeHCdrdSyLXxTFVVQbEy0GisfJ FqGqD X-Gm-Gg: ASbGnctqVwVcFHLpcfcfIY0akqqfnQyITM8KRkb/Q7+3bcBH+pM60SMq4i1QccSGDK1 dRs7rb7/uhxkXDrPO92oIJWV/QL4kk9NhaX+ZIXtX3FDDp0YVxYUCynTauzTrbT9Jr8AfGtm+gS I3Ku1KHbuwgzPLw0dl6xrJE0BUe+B6hD+lz/FgYwEw1j+42edzHbrKIYs8AuUU3bVXm4UdkEb5I /15C+vYIVE2poCPGev/UWLbeT8wYZ/MZwVyIbt9teww5M49sKhN2gjPoYnk6yf/KwZHaMlvzm3/ dC6bynaXOtEcZlfzVYNV45URL/UmOo93H91i+WTw/cXEfEX5uaQMo6OLwaptJFx8NM0+nC2rW9r ZeWZ3EW4cbFrwQT2Z1WUFfT033JGnjcLi0t1yiE0IyTIAjXfAZe8= X-Google-Smtp-Source: AGHT+IE+z14zf5+aQJHINm4BSOvhmyVX72plqj0OZoV/izjfwB0q31wqYZJugHryLIPrskdCHi/bbQ== X-Received: by 2002:a05:6000:2dc9:b0:3b5:f93a:bcc with SMTP id ffacd0b85a97d-3b60dd95cd5mr9177990f8f.35.1752846007423; Fri, 18 Jul 2025 06:40:07 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:5e:3808:4fde:3dab:9616:28c7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b61ca4d7fasm1862031f8f.69.2025.07.18.06.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 06:40:06 -0700 (PDT) Message-ID: <196cd52eacfb03ec788cadc4a8bf02c83207d9aa.camel@cybertec.at> Subject: Re: Regarding logical replication issues with PostgreSQL versions 16 and above From: Laurenz Albe To: yexiu-glory , pgsql-general Date: Fri, 18 Jul 2025 15:40:06 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2025-07-18 at 19:08 +0800, yexiu-glory wrote: > I'm facing a problem here: our business requires logical data replication= to other > departments, but at the same time, sensitive fields need to be filtered o= ut. > Therefore, we used the column filtering function when creating logical re= plication. > If we use `alter table table1 replica identity default;`, there is no iss= ue at all. > However, when encountering new business scenarios, we need to use the CSI= columnar > index function. Under the default setting, the synchronization delay of t= he CSI > columnar index is severe. Therefore, we need to use `alter table table1 r= eplica > identity full;` so that the CSI columnar index can perform data compariso= n and only > convert changed data when receiving data, thereby speeding up the data co= nversion > efficiency of the CSI columnar index. However, after using `alter table t= able1 > replica identity full;`, updating the table will result in an error. > ERROR: cannot update table "table1" > DETAIL: The column list used by the publication does not cover the replic= a identity. > So, is there any solution to this problem, or is there a better approach = to > accelerate the conversion efficiency of the CSI columnar index. I cannot help with that CSI thing. The only workaround I can think of is to create an index on the publisher t= hat contains all the columns you need in the replica identity and then using that with ALTER TABLE ... REPLICA IDENTITY USING INDEX ... Yours, Laurenz Albe