Re: PQexecPrepared() question

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Igor Korot <ikorot01@gmail.com>
Cc: "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2025-12-20T17:02:13Z
Lists: pgsql-general
On Fri, 2025-12-19 at 23:04 -0800, Igor Korot wrote:
> > SQL_ASCII as client encoding means that no conversion will take place.
> > 
> > Still, the database encoding (I suspect UTF8) will govern what can be stored
> > in the database.  Anything that is not valid UTF-8 will be rejected.
> 
> Rejected how?

As you experienced: by throwing an error.

> > A SELECT will never cause an error - the client will just receive data
> > in UTF-8.
> 
> And then what?

The *client application* will receive UTF-8 data.

Yours,
Laurenz Albe