pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jiří Pavlovský <jiri@pavlovsky.eu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".
Date: Mon, 1 Feb 2021 18:03:44 +0100
Message-ID: <8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu> (raw)
In-Reply-To: <3335118.1612191322@sss.pgh.pa.us>
References: <8b88f867-d0d0-6deb-8f13-48853a57080a@pavlovsky.eu>
	<3335118.1612191322@sss.pgh.pa.us>


On 01.02.2021 15:55, Tom Lane wrote:
> =?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= <jiri@pavlovsky.eu> 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 <unnamed>:
>>     
>>          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


Thanks for the answer.


I don't think triggers or constraints are the issue.

The exact same code works if I create a small test program with the same 
query and the same parameters.

But when used in the context of the whole application it gives the error.

  I don't know what should I try. I tried all possible combinations of 
parameters.

I have just even tried to disable triggers and remove any constraints 
from the table. Same error.






view thread (7+ messages)  latest in thread

Message-ID: <8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu>
Permalink:  ../8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu/
Also on:    postgresql.org/message-id/8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jiri@pavlovsky.eu, tgl@sss.pgh.pa.us
  Subject: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".
  In-Reply-To: <8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu>
  References: <8b88f867-d0d0-6deb-8f13-48853a57080a@pavlovsky.eu> <3335118.1612191322@sss.pgh.pa.us> <8c67bf16-e267-a40c-25da-ebc646d0753d@pavlovsky.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox