Re: postgres8.3beta encodding problem?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgres8.3beta encodding problem?
Date: 2007-12-18 15:35:39
Message-ID: 29305.1197992139@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-12-18 15:54:03 Re: postgres8.3beta encodding problem?
Previous Message Tom Lane 2007-12-18 15:29:06 Re: slony error --need help