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

2021-02-02 Thread Tom Lane
=?UTF-8?B?SmnFmcOtIFBhdmxvdnNrw70=?= writes: > Client and server encoding is UTF8. Locales are set to C.UTF8. If lc_messages is C then no translation of error strings would happen, so that theory goes out the window. Oh well. Perhaps you could attach gdb to the backend and get a stack trace fro

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

2021-02-02 Thread Jiří Pavlovský
On 02.02.2021 3:53, Tom Lane wrote: > rob stone writes: >> Columns:- maincontact boolean DEFAULT false, >> publdatacontact boolean DEFAULT false, >> invcontact boolean DEFAULT false, >> queries_recipient boolean, >> fakelastname boolean NOT NULL DEFAULT false, >> ar

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

2021-02-01 Thread Tom Lane
rob stone writes: > Columns:- maincontact boolean DEFAULT false, > publdatacontact boolean DEFAULT false, > invcontact boolean DEFAULT false, > queries_recipient boolean, > fakelastname boolean NOT NULL DEFAULT false, > are defined as booleans and all except one ha

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

2021-02-01 Thread rob stone
Hello, On Mon, 2021-02-01 at 18:03 +0100, Jiří Pavlovský wrote: > > > 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 co

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

2021-02-01 Thread Jiří Pavlovský
On 01.02.2021 15:55, Tom Lane wrote: =?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,

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

2021-02-01 Thread Tom Lane
=?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::

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

2021-02-01 Thread Jiří Pavlovský
I'm stuck trying to find a cause for > invalid byte sequence for encoding "UTF8". It is an C program using libpq. I'm using `PQexecParams` to execute the SQL query. The offending byte sequence is completely random, sometimes the command even runs ok. I thought I must have a memory allocation iss