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 1l6abv-0004gm-OS for pgsql-general@arkaria.postgresql.org; Mon, 01 Feb 2021 14:55:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6abu-00065z-NP for pgsql-general@arkaria.postgresql.org; Mon, 01 Feb 2021 14:55:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6abu-00065p-Fk for pgsql-general@lists.postgresql.org; Mon, 01 Feb 2021 14:55:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6abs-0004so-9v for pgsql-general@lists.postgresql.org; Mon, 01 Feb 2021 14:55:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 111EtMBe3335119; Mon, 1 Feb 2021 09:55:23 -0500 From: Tom Lane To: =?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= cc: pgsql-general@lists.postgresql.org Subject: Re: libpq and mysterious "invalid byte sequence for encoding UTF8". In-reply-to: <8b88f867-d0d0-6deb-8f13-48853a57080a@pavlovsky.eu> References: <8b88f867-d0d0-6deb-8f13-48853a57080a@pavlovsky.eu> Comments: In-reply-to =?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= message dated "Mon, 01 Feb 2021 11:46:10 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3335117.1612191322.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 01 Feb 2021 09:55:22 -0500 Message-ID: <3335118.1612191322@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= writes: >     Jan 26 08:40:57 ip-172-16-10-94 postgres[11334]: [113-1] 2021-01-26 > 09:40:57.505 CET [11334] jira@project-syndicate LOG:  execute : >     >         UPDATE contacts SET Pos = $1::varchar, Title = $2::varchar, > PaperID = $3::int, FirstName = $4::varchar, LastName = $5::varchar, Func > = $6::varchar, Tel1 = $7::text, Fax1 = $8::text, Email1 = $9::varchar, > Tel2 = $10::text, Fax2 = $11::text, Email2 = $12::varchar, MainContact = > $13::boolean, PublDataContact = $14::boolean, InvContact = $15::boolean > WHERE ContactID = $16::int >         Jan 26 08:40:57 ip-172-16-10-94 postgres[11334]: [113-2] > 2021-01-26 09:40:57.505 CET [11334] jira@project-syndicate DETAIL:  > parameters: $1 = NULL, $2 = NULL, $3 = '1702', $4 = NULL, $5 = NULL, $6 > = NULL, $7 = NULL, $8 = NULL, $9 = NULL, $10 = NULL, $11 = NULL, $12 = > NULL, $13 = NULL, $14 =  NULL, $15 = NULL, $16 = '14340' >         Jan 26 08:40:57 ip-172-16-10-94 postgres[11334]: [114-1] > 2021-01-26 09:40:57.544 CET [11334] jira@project-syndicate ERROR:  > invalid byte sequence for encoding "UTF8": 0x80 This log entry shows that your query text and parameters all made it to the backend just fine. So I don't think your issue is on the client side. I'm wondering if the error could be from (say) triggers doing fancy data manipulations. Noting your use of ON UPDATE CASCADE, it'd be worth checking indirectly-affected tables as well. regards, tom lane