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 1v3aa4-000inm-Tu for pgsql-general@arkaria.postgresql.org; Tue, 30 Sep 2025 13:39:49 +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 1v3aa2-00A6KE-UI for pgsql-general@arkaria.postgresql.org; Tue, 30 Sep 2025 13:39:47 +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 1v3aa2-00A6K3-C7 for pgsql-general@lists.postgresql.org; Tue, 30 Sep 2025 13:39:47 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3aa0-000hun-1n for pgsql-general@postgresql.org; Tue, 30 Sep 2025 13:39:46 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-b463f986f80so56890066b.2 for ; Tue, 30 Sep 2025 06:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemguards.com.ec; s=google; t=1759239578; x=1759844378; darn=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=x5LBT92M6SWWIgQ6Xspm2fxCfrJMwlJLqFfw3W6/J3s=; b=X2SbDsJV6QNvs0bfTnw+0TrRFZIOnL5XRXtJStvx3fyfGl5QbNHs7mswfpSyI0gUka /VpL9ML1Mye/PMUm8p3et1l8VuU5UUAlP65DYTYWEO5Jo1FUs88YCoPQPMLsipzIA60p hEM3fXG+MPLQH0FE9puOPvNyfBGUS7AsJI26ORYzNb5c3RoNMkxrAQ9jPJLGfkb9e209 d61AwszBQsSYr6oOrUENl6hMQqqIEbSL/U2HtJ41SbMF8OnRmoZLbBoinLQJ7OD1beTR KeyrgDJ+scKcyWCckMwGpkPxITMsC25BOU7k9VLpGTAbHbt3d8UwKRazrZaDm8UpImT+ /nAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759239578; x=1759844378; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x5LBT92M6SWWIgQ6Xspm2fxCfrJMwlJLqFfw3W6/J3s=; b=VOUvkZdiLVWARGBeq86x7oxq/f3wTiVfQoJKIiENmN+Pb8yZ7/uLnf6afGE25o+1Nv uoP2ZfszeL0rkRQdZXYDHl62ZRV2kUt57YpKW7IWLRYieMArgWlKbm71sEkHzzLTncD4 dLSUZ/ooeOFZiakpW3xrPVEZkuvESEGd4Ct1OkPwThbRXksg6Z9a2hl8RGnjQSizkE/K 9V/PSXMzUCdK4EMrtHDAvx6YH8Frr9Eke8fYbDiEW9Ub8FYaaeGfLOe+WFqNMydSxQTm F69+1DB27a+PcRaVVAsSofDnv4BltP7ida6TzHrEJEKBbJhwnUFrA4p16dD7DpofStS2 kLcA== X-Gm-Message-State: AOJu0YyPAepilMIvhvZdEAcM23vF/NuZfAEDWu/POZEJdW4QDM7VFjMH uKYHojCcfc+dUPCPvwZp94DschCFOO7pTiG38mSh8llSwUnPbOVv2BpaZoF4SNI+pSVO7K9sVp0 ABrVQdtL6EQDhPwKHkhuktqVdo0rdzZDrTQqQEsNLMlFA3XGa22N0vkAjWqWd X-Gm-Gg: ASbGncuH/lQuTf1wWZ1/+3r5U1VSvcNzBm4Dk1CcOrh06biE4BZNN9mkls5kqj1kxLW je5rJMV3CP9FkQExrAayhlUNq8A3qlnvI5WYTJCy3ZOYv25K/yhfu9e3mdM9Eloys5RFDwtwSdr 9yFFxsmjWf79luM18QXYeyRJkaQsKWoJzIvLYnL6WmgtKyp2k/GNZqI+1eNdZ+vQKSrcEKttGXa 8dh9JwnhKOphj5GgdmAD8mhKXTxOtck X-Google-Smtp-Source: AGHT+IHAnk+mNAajPK34IAKiKdtn/WZAZq4Uh8KSGSc+gZfIh2TClbn0PZN20lz0+VVio1x3rVodPyhFe6XMin+sr6Q= X-Received: by 2002:a17:907:7fa9:b0:b3a:7af8:c4a2 with SMTP id a640c23a62f3a-b3a7af8ca29mr1364346766b.10.1759239576633; Tue, 30 Sep 2025 06:39:36 -0700 (PDT) MIME-Version: 1.0 References: <235410a2-99dd-47ae-9f26-86b00b7d0623@aklaver.com> In-Reply-To: <235410a2-99dd-47ae-9f26-86b00b7d0623@aklaver.com> From: Jaime Casanova Date: Tue, 30 Sep 2025 08:39:24 -0500 X-Gm-Features: AS18NWCn_9ZJRp4xGd9o4HkvGdso_bQjOcCWJXf71f-aPP4OmxWUs4DYlB4uvxo Message-ID: Subject: Re: encoding problem while inictial copy in logical replication To: Adrian Klaver Cc: Postgres General 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 Tue, Sep 16, 2025 at 12:44=E2=80=AFPM Adrian Klaver wrote: > > On 9/16/25 04:01, Jaime Casanova wrote: > > Hi, > > > > I have a database with UTF8 encoding. This database seems to be > > receiving data in WIN1252 encoding from some client. > > [...] > > > > 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 24= 89 > > 2025-09-16 09:20:23.041 UTC [1463234] LOG: background worker "logical > > replication worker" (PID 1535715) exited with exit code 1 > > [...] > > > > Any idea? Currently my process is to manually copy the data. > > Read this?: > > https://www.i18nqa.com/debug/bug-double-conversion.html > https://www.i18nqa.com/debug/utf8-debug.html > > Bottom line 0x8d is unassigned in WIN1252 and there is no UTF8 > equivalent for it and four other code points. > > The solution would seem to be determining what is using this code point > and stopping it's use if possible. > But then, why pg_dump works if it's also using COPY? -- Jaime Casanova SYSTEMGUARDS Director de servicios profesionales