pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCopying into Unicode - Correcting Errors
3+ messages / 2 participants
[nested] [flat]
* Copying into Unicode - Correcting Errors
@ 2004-11-23 23:56 Hunter Hillegas <lists@lastonepicked.com>
0 siblings, 1 reply; 3+ messages in thread
From: Hunter Hillegas @ 2004-11-23 23:56 UTC (permalink / raw)
To: PostgreSQL <pgsql-general@postgresql.org>
I need to import a file into a Unicode database.
I am getting an error:
ERROR: Unicode characters greater than or equal to 0x10000 are not
supported
CONTEXT: COPY mailing_list_entry, line 30928, column first_last_name:
"Ver?nica"
The source file came from pg_dump... Is there a way I can easily find rows
like this in the database so I can remove them before I export->import?
It looks like the source database has a lot of garbage in it... I guess I'm
asking if there is an 'easy' way to identify the rows that have issues so I
can deal with them... The table has 400,000 rows so locating them by hand is
not desirable.
I am running on 8.0b5 on MacOS X.
Thanks,
Hunter
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Copying into Unicode - Correcting Errors
@ 2004-11-24 10:19 Peter Eisentraut <peter_e@gmx.net>
parent: Hunter Hillegas <lists@lastonepicked.com>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Eisentraut @ 2004-11-24 10:19 UTC (permalink / raw)
To: Hunter Hillegas <lists@lastonepicked.com>; +Cc: PostgreSQL <pgsql-general@postgresql.org>
Hunter Hillegas wrote:
> I need to import a file into a Unicode database.
>
> I am getting an error:
>
> ERROR: Unicode characters greater than or equal to 0x10000 are not
> supported
> CONTEXT: COPY mailing_list_entry, line 30928, column
> first_last_name: "Ver?nica"
If your file really does have Unicode characters greater than or equal
to 0x10000, then I don't have a good answer.
But more often, this error means that your file is not in Unicode in the
first place. If so, set the client encoding to the real encoding of
your file, e.g.
export PGCLIENTENCODING=LATIN1
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Copying into Unicode - Correcting Errors
@ 2004-11-24 16:25 Hunter Hillegas <lists@lastonepicked.com>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 3+ messages in thread
From: Hunter Hillegas @ 2004-11-24 16:25 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: PostgreSQL <pgsql-general@postgresql.org>; pgsql-jdbc
Peter,
Thanks for the reply.
Perhaps I should go into some more detail about what is going on.
Originally, the database was in SQL_ASCII and the data had been imported via
COPY from a text file. The text file is no longer available. The data went
into the table just fine.
When selecting from the table via JDBC, I see this exception:
'Invalid character data was found. This is most likely caused by stored
data containing characters that are invalid for the character set the
database was created in. The most common example of this is storing 8bit
data in a SQL_ASCII database.'
Ok, so I've never seen this but I do a little investigation and some of the
stuff I see online suggests that I should change the database encoding.
When I try UNICODE, I get the error below during my data import.
The 'bad' data looks like this when I SELECT:
| Ver?onica |
Is it possible that this is an issue with beta5 in conjunction with the JDBC
driver and encoding? I didn't see a CHANGELOG note that would make me
suspicious but I'm not sure I would know if it I saw it.
Hunter
> From: Peter Eisentraut <peter_e@gmx.net>
> Date: Wed, 24 Nov 2004 11:19:44 +0100
> To: Hunter Hillegas <lists@lastonepicked.com>
> Cc: PostgreSQL <pgsql-general@postgresql.org>
> Subject: Re: [GENERAL] Copying into Unicode - Correcting Errors
>
> Hunter Hillegas wrote:
>> I need to import a file into a Unicode database.
>>
>> I am getting an error:
>>
>> ERROR: Unicode characters greater than or equal to 0x10000 are not
>> supported
>> CONTEXT: COPY mailing_list_entry, line 30928, column
>> first_last_name: "Ver?nica"
>
> If your file really does have Unicode characters greater than or equal
> to 0x10000, then I don't have a good answer.
>
> But more often, this error means that your file is not in Unicode in the
> first place. If so, set the client encoding to the real encoding of
> your file, e.g.
>
> export PGCLIENTENCODING=LATIN1
>
> --
> Peter Eisentraut
> http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-11-24 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-23 23:56 Copying into Unicode - Correcting Errors Hunter Hillegas <lists@lastonepicked.com>
2004-11-24 10:19 ` Peter Eisentraut <peter_e@gmx.net>
2004-11-24 16:25 ` Hunter Hillegas <lists@lastonepicked.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox