Martijn van Oosterhout <kleptog@svana.org> writes:
> On Mon, Dec 17, 2007 at 10:13:54AM -0800, Jeff Davis wrote:
>> http://www.postgresql.org/docs/8.3/static/release-8-3.html
> Ok, but that doesn't apply in this case, his database appears to be
> LATIN1 and this character is valid for that encoding...
You know what, I think the test in the code is backwards.
is_mb = pg_encoding_max_length(encoding) > 1;
if ((is_mb && (cvalue > 255)) || (!is_mb && (cvalue > 127)))
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("requested character too large for encoding: %d",
cvalue)));
Shouldn't we be allowing up-to-255 for single-byte encodings, not
multibyte?
regards, tom lane