Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvQAV-0002N8-J5 for pgsql-bugs@arkaria.postgresql.org; Sun, 29 May 2022 21:09:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvQAU-0001cg-DG for pgsql-bugs@arkaria.postgresql.org; Sun, 29 May 2022 21:09:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvQAU-0001cX-1z for pgsql-bugs@lists.postgresql.org; Sun, 29 May 2022 21:09:46 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvQAP-0005s1-RG for pgsql-bugs@lists.postgresql.org; Sun, 29 May 2022 21:09:45 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54f8d8-220.dhcp.inet.fi [84.248.216.220]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 58FFD1B0004B; Mon, 30 May 2022 00:09:38 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1653858578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hRK5zMWWaVZUjbdVLERaQwzCrW1GUgXa+DO/2HoBraM=; b=fG/lkPT+7GiJvuw8s5OH/Pa8Ut/ZPaKhF5HBJNDJafmnFX1fyWkyIhddP8+AQE0f+x4eY4 /UCWS4rFqxiLSODKSUocP7197F05D35wT/8OliUNDsIFjCNIfjKxOsiZGk0s4CqpJGkfDv hEBFg3TypN+JBBZgpQ6XPM/24qH0bK5lNeG8zcjOvefflZCOD6wgunmk4BcIe2RSMYpEtM b8m7TQBm1XdlPTvV8lcQvwKzuexxnyDDkq1iIe4rY2QpWqfgEPLd/39dYs1BtFRV2c+mG1 XGZ9WX58ceLI4+ywbJDIB3NAsTH12CGmTJtOWZgBR3elBFTd01OfS8wa5cZpwQ== Message-ID: <6a8f67f2-3baa-1acd-5798-5effe0ce731c@iki.fi> Date: Mon, 30 May 2022 00:09:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: BUG #17501: COPY is failing with "ERROR: invalid byte sequence for encoding "UTF8": 0xe5" Content-Language: en-US From: Heikki Linnakangas To: wizard_1024@tut.by References: <17501-128b1dd039362ae6@postgresql.org> <196eab40-0754-0fe5-1419-b50459fbb6fc@iki.fi> Cc: pgsql-bugs@lists.postgresql.org In-Reply-To: <196eab40-0754-0fe5-1419-b50459fbb6fc@iki.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1653858578; a=rsa-sha256; cv=none; b=JohF80HmTB6glD2h0Wo0Hv7VhjQVWAH5jy+DqgLi3kk7NzlmmuALXcAmiVlL14VPWsML4b Mt/c1OqYers/sfFuPWVzohn+BWOWI4JyNo3ocinrKOLE6XOzs4cH/ouSO7EYZibFXzBLXv VWkoN34muq5WWDLZmFDshBNbivdLS0QYYsMJPt4EyA7cNQKmAK3D0tI9PpjE3XuicAQZ99 JYKdWKxVsSXQMdLHCerZHke18yz/Sbiq+sggK7DCb0e05btgOZa16bMUIYB44ClwDPtOa9 z6G/khm+SMcLlt8y0MXjKBu02ww5kXpuGTaollWVCXyjPLjTL18vxeM4BZAerw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1653858578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hRK5zMWWaVZUjbdVLERaQwzCrW1GUgXa+DO/2HoBraM=; b=j1PY6EwBF28JVghLnx+CtXnq91YJ6+Yv9CWe1wzEuTMqTQBoIl9ibtsXviyohcVfcvGLs9 snbANyhtPPKehuxUWN1biX3nTdtpGo0sqO0ZePH1LW//nH810hxkUSqIlk/B+rny9ShZOZ fhg0HPvtWF+Ym2V3WhwITrI5hLgRcidWxEh/K1v/EFRAtdXq+yy99BAOxSbVy6mPK5hilK FHQPYQukuSHZKxmsR6I7xE2rS3X2YtkqehRdxxZ2zlfC1NoO+WvvDKSi3PAYvYElAsRSlW uOGxnYMcFm9KR6n0PHdfGXzFsXkGVPYdfRemYlza9NmUta1VwhG+pN2EsqgZUw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 29/05/2022 13:39, Heikki Linnakangas wrote: > On 28/05/2022 23:52, PG Bug reporting form wrote: >> The following bug has been logged on the website: >> >> Bug reference: 17501 >> Logged by: Vitaly Voronov >> Email address: wizard_1024@tut.by >> PostgreSQL version: 14.3 >> Operating system: CentOS Linux release 7.9.2009 (Core) >> Description: >> >> Hello, >> >> We've seen a such bug: COPY command shows error "ERROR: invalid byte >> sequence for encoding "UTF8": 0xe5" on file. >> The same file with small amount of lines is imported without any errors. > > I was able to reproduce this with your instructions. Thank you! > > The bug was indeed introduced by commit f82de5c46b, in v14. Attached > patch fixes it. Barring any objections, I'll commit and backpatch this. > > I also noticed that there are some outdated comments in copyfromparse.c > that still talk about the old protocol version 2 and COPY_OLD_FE. I'll > clean that up as a separate commit. Committed. And I included those comment changes in the same commit, after all. Thanks for the report! - Heikki