Thread: Re: Bug #814
I note that this bug was opened in December 2002. To recap, you get an ArrayIndexOutOfBoundsException at org.postgresql.core.Encoding.decodeUTF8 in Encoding.java line 253 whenever it encounters a character from the extended keyboard. I have Postgres 7.3.2 with SQL_ASCII (default?) encoding and no locale. But a lot of the text in our database is in Italian. So programmes crash as soon as they meet any italian accented character when using the new JDBC jars. I come across the same bug using both the JDBC2 and JDBC3 jars. Anyone know of plans to deal with this bug? Any information would be gratefully received. Kind regards, Malcolm Warren
Malcolm, This has been "fixed" in the latest builds of the 7.3 driver. Download from jdbc.postgresql.org. The "fix" was to just report a better error message in this case. If you are storing non-ascii data, you are going to need your database to be running with an encoding that can store that data. Thus in your situation as you are reporting below you would need to recreate your database in latinX or unicode. thanks, --Barry Malcolm Warren wrote: > I note that this bug was opened in December 2002. > > To recap, you get an ArrayIndexOutOfBoundsException at > org.postgresql.core.Encoding.decodeUTF8 in Encoding.java line 253 > whenever it encounters a character from the extended keyboard. > > I have Postgres 7.3.2 with SQL_ASCII (default?) encoding and no locale. > But a lot of the text in our database is in Italian. > So programmes crash as soon as they meet any italian accented character > when using the new JDBC jars. > I come across the same bug using both the JDBC2 and JDBC3 jars. > > Anyone know of plans to deal with this bug? Any information would be > gratefully received. > > Kind regards, > Malcolm Warren > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >
Hi Barry, Thank you for your reply. Can you tell me how to convert my database? I have tried using initdb with encoding UNICODE, and changing the CREATEDB line in my dump from SQL_ASCII to UNICODE, but this doesn't work. Any information welcome as I've searched the net, without finding anything that helps. Thanks, Malcolm Warren On Fri, 12 Sep 2003 18:26:36 -0700, Barry Lind <blind@xythos.com> wrote: > Malcolm, > > This has been "fixed" in the latest builds of the 7.3 driver. Download > from jdbc.postgresql.org. > > The "fix" was to just report a better error message in this case. If you > are storing non-ascii data, you are going to need your database to be > running with an encoding that can store that data. Thus in your > situation as you are reporting below you would need to recreate your > database in latinX or unicode. > > thanks, > --Barry > > Malcolm Warren wrote: >> I note that this bug was opened in December 2002. >> >> To recap, you get an ArrayIndexOutOfBoundsException at >> org.postgresql.core.Encoding.decodeUTF8 in Encoding.java line 253 >> whenever it encounters a character from the extended keyboard. >> >> I have Postgres 7.3.2 with SQL_ASCII (default?) encoding and no locale. >> But a lot of the text in our database is in Italian. >> So programmes crash as soon as they meet any italian accented character >> when using the new JDBC jars. >> I come across the same bug using both the JDBC2 and JDBC3 jars. >> >> Anyone know of plans to deal with this bug? Any information would be >> gratefully received. >> >> Kind regards, >> Malcolm Warren >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 9: the planner will ignore your desire to choose an index scan if >> your >> joining column's datatypes do not match >> > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > > -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Malcolm, Without knowing what errors you are seeing, I can't say for sure what is going wrong for you. However the following seems to work for me: pg_dump -f test.dmp testdb createdb -E unicode newtestdb psql -f test.dmp newtestdb thanks, --Barry Malcolm Warren wrote: > Hi Barry, > Thank you for your reply. > Can you tell me how to convert my database? > > I have tried using initdb with encoding UNICODE, and changing the > CREATEDB line in my dump from SQL_ASCII to UNICODE, but this doesn't work. > > Any information welcome as I've searched the net, without finding > anything that helps. > > Thanks, > Malcolm Warren > > > On Fri, 12 Sep 2003 18:26:36 -0700, Barry Lind <blind@xythos.com> wrote: > >> Malcolm, >> >> This has been "fixed" in the latest builds of the 7.3 driver. >> Download from jdbc.postgresql.org. >> >> The "fix" was to just report a better error message in this case. If >> you are storing non-ascii data, you are going to need your database to >> be running with an encoding that can store that data. Thus in your >> situation as you are reporting below you would need to recreate your >> database in latinX or unicode. >> >> thanks, >> --Barry >> >> Malcolm Warren wrote: >> >>> I note that this bug was opened in December 2002. >>> >>> To recap, you get an ArrayIndexOutOfBoundsException at >>> org.postgresql.core.Encoding.decodeUTF8 in Encoding.java line 253 >>> whenever it encounters a character from the extended keyboard. >>> >>> I have Postgres 7.3.2 with SQL_ASCII (default?) encoding and no >>> locale. But a lot of the text in our database is in Italian. >>> So programmes crash as soon as they meet any italian accented >>> character when using the new JDBC jars. >>> I come across the same bug using both the JDBC2 and JDBC3 jars. >>> >>> Anyone know of plans to deal with this bug? Any information would be >>> gratefully received. >>> >>> Kind regards, >>> Malcolm Warren >>> >>> ---------------------------(end of broadcast)--------------------------- >>> TIP 9: the planner will ignore your desire to choose an index scan if >>> your >>> joining column's datatypes do not match >>> >> >> >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 4: Don't 'kill -9' the postmaster >> >> > > >
On Mon, 15 Sep 2003, Barry Lind wrote: > Malcolm, > > Without knowing what errors you are seeing, I can't say for sure what is > going wrong for you. However the following seems to work for me: > > pg_dump -f test.dmp testdb > createdb -E unicode newtestdb > psql -f test.dmp newtestdb If you have non-unicode characters in the ascii database the restore to a unicode database will fail. People have recommended running iconv on the dump file to convert it to unicode, for me setting PGCLIENTENCODING=UNICODE before the dump of the original database fixed the problem with bad characters. Kris Jurka