Nevermind, I went ahead and did the initdb --locale=C and reloaded the
db. Now the Encoding on the db is SQL_ASCII (instead of UNICODE) and
the queries work fine. Pg_dump is your friend! ;-)
Rgds,
Bret
> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of
> Schuhmacher, Bret
> Sent: Tuesday, February 01, 2005 8:04 AM
> To: pgsql-novice@postgresql.org
> Subject: [NOVICE] LC_CTYPE question
>
> I've got a database full of business names in the US.
> Apparently I've got some multibyte data I didn't know
> about... When I run a query that returns one of these
> multibyte strings I get this error:
>
> ERROR: invalid multibyte character for locale
> HINT: The server's LC_CTYPE locale is probably incompatible
> with the database encoding.
>
> My lc_ctype is set to:
> lc_ctype | en_US.UTF-8
>
> Is there any way to allow more encoding types? I've read the
> docs on encoding and it looks like I need to redo my initdb
> and reload the db :-(. When I created my db it got set to
> UNICODE by default (I didn't specify one). Which en_US
> setting will allow multibyte data? Is this error saying
> en_US.UTF-8 is incompatible with UNICODE?
>
> FWIW, I have a windows installation running "PostgreSQL
> 8.0.0beta3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> 3.2.3 (mingw special 20030504-1)"
> And its lc_ctype is "C" and the *exact same data* loaded and
> it works fine.
>
> The db in question is
> PostgreSQL 8.0.0rc5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
> 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
> Its lc_ctype is en_US.UTF-8
>
> Should I re-run initdb with '--lc_ctype=C'?
>
>
> Thanks for your insight into this.
>
> Rgds,
>
> Bret
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>