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

From: Jiří Pavlovský <jiri(at)pavlovsky(dot)eu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, rob stone <floriparob(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".
Date: 2021-02-02 10:11:49
Message-ID: a2a995a2-8b2f-d0ca-7b53-f79d68645ab4@pavlovsky.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02.02.2021 3:53, Tom Lane wrote:
> rob stone <floriparob(at)gmail(dot)com> 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 have defaults declared, yet
>> you are passing NULL's which the insert tries to cast to boolean.
>> Maybe this is the cause of the error??
> Oooh ... if we posit that the statement is expected to throw an error,
> maybe what this error is complaining about is an inability to translate
> a localized error message to the client's encoding. This could reflect
> an incorrectly-encoded .po file, for example. So what we need to know
> next is what lc_messages setting Jiří is using, and also the server
> and client encodings.

Still, this does not explain why it sometimes work and why the byte
sequence in the error message changes on every run, no?

I'm getting the error even when I changes the boolean fields from NULL
to FALSE.

Client and server encoding is UTF8. Locales are set to C.UTF8.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2021-02-02 10:22:00 Re: Index created with PGSQL11 on ubuntu 18.04 corrupt with PGSQL11 on ubuntu 20.04
Previous Message unilynx 2021-02-02 09:59:50 Index created with PGSQL11 on ubuntu 18.04 corrupt with PGSQL11 on ubuntu 20.04