Re: A bad behavior under autocommit off mode - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: A bad behavior under autocommit off mode
Date
Msg-id Pine.LNX.4.44.0303221737270.2352-100000@peter.localdomain
Whole thread Raw
In response to Re: A bad behavior under autocommit off mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A bad behavior under autocommit off mode  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> I had originally been thinking of reporting client_encoding as a field
> of some message sent only at backend startup.  However, what if we send
> such a message whenever one of the variables it includes changes?

The silent assumption behind the client_encoding parameter is that you
must set it to the actual character set encoding used by the client.  If
you lie, the results are unspecified.  So if you're in a JDBC application
and set the client encoding to an encoding that the JDBC driver (that is,
"the client") cannot handle, you lied and you deserve to lose.  (Really,
this problem can only occur in applications that let random users enter
random commands or if a programmer is explicitly trying out forbidden
territory.)

There are real and valid reasons for changing the client encoding on the
fly, but that is no reason to make a big deal about passing the
information around all the time.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: elein
Date:
Subject: Fwd: [GENERAL] statement id
Next
From: Tom Lane
Date:
Subject: Re: A bad behavior under autocommit off mode