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 1uyTRM-008a8W-0X for pgsql-general@arkaria.postgresql.org; Tue, 16 Sep 2025 11:01:41 +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 1uyTRJ-00HAX8-MZ for pgsql-general@arkaria.postgresql.org; Tue, 16 Sep 2025 11:01:38 +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 1uyTRI-00HAX0-1m for pgsql-general@lists.postgresql.org; Tue, 16 Sep 2025 11:01:38 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uyTRG-000iDF-2A for pgsql-general@postgresql.org; Tue, 16 Sep 2025 11:01:35 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-b042eb09948so1096546466b.3 for ; Tue, 16 Sep 2025 04:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemguards.com.ec; s=google; t=1758020487; x=1758625287; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=gFg2XUnbCZbzThvoYO/9ktqOLi0dg1D64+a4SKsyroQ=; b=ELxBDiWaRDzkSFji7OSrmDM7TEGR4SHMJc3N5L8cuHiKtxvSU3P5U5pBKPN2LSVs6O MSwD/cw8CVLIq9I5BqPNSH+Xcah9qujOnAdBYM2qCtXe+XYW/Q/da25cyeW44dUWcL5K BMbwrWFPvt/56nyZGX/bFEQSbsuxcGGF9FnaCFe81zbeLbHKfQW0YCXj8EgtxD6W0mcO 2xjrlXqPJZEYQHCtcK0uc9uFCvJ9cPuEDGWQiksss4q9pfo+r81Q7rB1Q0BfQDRkrFps fYd+kztDNFIOFVUD6Ofwn81Bf2+rrqH5gzLTy2EB8ZQVYNVwvYFRBGVife8g/ixPfMs1 HOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758020487; x=1758625287; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gFg2XUnbCZbzThvoYO/9ktqOLi0dg1D64+a4SKsyroQ=; b=gL7iFovYzZuCqcQnDfVEX98v8lujpXuVe89tii6A5Wlj28huWiQNeJQQJMlPUdz8WN TWv6Q7uao03oqYKQh9RBoNozvlHHPmtxllQEIkdGpKOMrlbfcQP6d3LTE9Z6y704+tRj jNq6v9huEg1fPytOY+OG8vZgdaUSl+ht7WF3dt1+h/1m/Utn1d6y1O0V8Kx1gimoQOOG NYRVx4SnATRqT1jj+764L2DMPrh2vwAuct3Pv2AxEXt19WwNGWziDO+lSomh9FdDDFRm dyLzGr+9iTcSckrK4JP5HomtnDcMubAm562aSVECDUgVEssI5JLllmFUzwNjqgfqHV1p Wbkg== X-Gm-Message-State: AOJu0Ywekey5xeiA6w5Lt/+4Sg9isuhoiEpClFaJw22wMEwLXoCIklFW /j1CLjRqkgIcSSbqG7Mif3FJjm6GlYXc3dAbWpInFkbAf+2E75/ognbcxTd6dPMtjH6fHF/j8vE 9ArJlYQBeQQsU/szhyJ1GIk/Gnu+qjVHC1OhgosXk/KTNNruXWoX99qU61g== X-Gm-Gg: ASbGnctjbaMDqf1LfHNvM3tW4YOallErdRCmffMMW3sTvXFddlUAxAfJvgL5BRC1I+P U/+1mRgcKqbgCLTqGInMeMYLO+D80fjCf8YVnfBv07bAkymT6QAMkcje9VlZYTSZPiXeaMPc0sO z64K8Ge2Iq/ExCGsmSEohppQ/pbrvaltOK745hHYJsRqlL2aZZb4SEwCRQNV29gSY0scl279ZGh 9rVX00/I3OD0eXGobUcDT2gqA== X-Google-Smtp-Source: AGHT+IG+7QWuyU+zSgHIKyPhe/p8IlZRgjac706dm2H04+OhpA6bFZv169hoI41b3lfIJcYHiMCdVetJTjPFZmJ/NAk= X-Received: by 2002:a17:906:4448:b0:b07:c905:9e1d with SMTP id a640c23a62f3a-b07c905a688mr1210381266b.62.1758020487301; Tue, 16 Sep 2025 04:01:27 -0700 (PDT) MIME-Version: 1.0 From: Jaime Casanova Date: Tue, 16 Sep 2025 06:01:15 -0500 X-Gm-Features: AS18NWCV9MvjbyG_pJPbIatj7oLTdI_nnQVBDr-ZqCjE-0it8cUeaiOii7EiYuw Message-ID: Subject: encoding problem while inictial copy in logical replication To: Postgres General Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I have a database with UTF8 encoding. This database seems to be receiving data in WIN1252 encoding from some client. I even see this: db=# select * from pg_db_role_setting ; setdatabase | setrole | setconfig -------------+----------+------------------------------------------------------------------------------- 119464 | 0 | {client_encoding=WIN1252,bytea_output=escape,standard_conforming_strings=off} (1 rows) Some time ago I tried to create a logical replication, for a speed up I used I created a physical replica and converted it in a logical one and it works fine. But the I tried to add a new table to the replica, so I added it to the publication and when I "ALTER SUBSCRIPTION .... REFRESH PUBLICATION" got this error. 2025-09-16 08:20:24.971 UTC [1535715] LOG: logical replication table synchronization worker for subscription "sub1", table "new_table" has started 2025-09-16 09:20:23.037 UTC [1535715] ERROR: character with byte sequence 0x8d in encoding "WIN1252" has no equivalent in encoding "UTF8" 2025-09-16 09:20:23.037 UTC [1535715] CONTEXT: COPY new_table, line 2489 2025-09-16 09:20:23.041 UTC [1463234] LOG: background worker "logical replication worker" (PID 1535715) exited with exit code 1 But if I pg_dump the data directly to the table in the subscription and avoid the initial copy using copy_data=false, it works fine. I tried to "SET client_encoding=UTF8" before the refresh and also created an user that defaults to client_encoding=UTF8 for using it in the subscription connection, but I still see the problem during the initial copy of data. AFAICS, this doesn't ocurr during normal replication process. Any idea? Currently my process is to manually copy the data. -- Jaime Casanova SYSTEMGUARDS Director de servicios profesionales