Re: libpq and mysterious "invalid byte sequence for encoding UTF8".

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jiří Pavlovský <jiri(at)pavlovsky(dot)eu>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".
Date: 2021-02-01 14:55:22
Message-ID: 3335118.1612191322@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= <jiri(at)pavlovsky(dot)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(at)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(at)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(at)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-02-01 16:15:51 Re: permission denied for large object 200936761
Previous Message Andrus 2021-02-01 14:43:29 permission denied for large object 200936761