Re: PQexecPrepared() question - Mailing list pgsql-general

From Tom Lane
Subject Re: PQexecPrepared() question
Date
Msg-id 61121.1766295563@sss.pgh.pa.us
Whole thread Raw
In response to Re: PQexecPrepared() question  (Igor Korot <ikorot01@gmail.com>)
Responses Re: PQexecPrepared() question
List pgsql-general
Igor Korot <ikorot01@gmail.com> writes:
> I added the following code in my app:
>     res = PQexec( m_db, "SHOW client_encoding" );
>     auto value = PQgetvalue( res, 0, 0 );
>     PQclear( res );
> and the value of the "value" variable is "UTF8".

Okay ...

> The exact error message is:
> ERROR: invalid byte sequence for encoding UTF8: 0xdf
> CONTEXT: unnamed portal parameter $1
> on the INSERT.

client_encoding governs both the encoding that the server will
send, and the encoding that it expects to receive.  You are
sending a parameter string that is not valid UTF8.

            regards, tom lane



pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Re: PQexecPrepared() question
Next
From: "David G. Johnston"
Date:
Subject: Re: PQexecPrepared() question