Unix Technical Forum

BUG #2071: ERROR: invalid multibyte character for locale

This is a discussion on BUG #2071: ERROR: invalid multibyte character for locale within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2071 Logged by: Prakash Nair Email address: prakashblr@hotmail.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:29 AM
Prakash Nair
 
Posts: n/a
Default BUG #2071: ERROR: invalid multibyte character for locale


The following bug has been logged online:

Bug reference: 2071
Logged by: Prakash Nair
Email address: prakashblr@hotmail.com
PostgreSQL version: 8.0.4
Operating system: RHES
Description: ERROR: invalid multibyte character for locale
Details:

Hello,

Got the error in postgres console when we do a lower() or upper().

Postgres console gives following error,

ERROR: invalid multibyte character for locale
HINT: The server's LC_CTYPE locale is probably incompatible with the
database encoding.

Can any one please help me, I need to use Unicode encoding for my database.
(Not able to upgrade to postgres 8.10. as I was getting someother issues
when I try to restore database)

Looks forward for anyone's fast reply.

Thanks,
Prakash

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:30 AM
Tomas Zerolo
 
Posts: n/a
Default Re: BUG #2071: ERROR: invalid multibyte character for locale

On Fri, Nov 25, 2005 at 11:55:44AM +0000, Prakash Nair wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2071
> Logged by: Prakash Nair
> Email address: prakashblr@hotmail.com
> PostgreSQL version: 8.0.4
> Operating system: RHES
> Description: ERROR: invalid multibyte character for locale
> Details:
>
> Hello,
>
> Got the error in postgres console when we do a lower() or upper().
>
> Postgres console gives following error,
>
> ERROR: invalid multibyte character for locale
> HINT: The server's LC_CTYPE locale is probably incompatible with the
> database encoding.
>
> Can any one please help me, I need to use Unicode encoding for my database.
> (Not able to upgrade to postgres 8.10. as I was getting someother issues
> when I try to restore database)


See the related, previous post.

Basically there are four places where encoding might be relevant:

- Did you create the database in utf-8 encoding? (probably yes)

- What is the nevironment of the server process? That is: what does the
shell command 'locale' say when it is issued in the same environment
as the server starts? (that is not necessarily the environment you get
if you start a shell!). Try, e.g. putting ''export LANG=us_US.UTF-8''
just before the server is called (typically in /etc/init.d/postgresql
or thereabout.

- What is your client's encoding (issue the SQL command ''SHOW
CLIENT_ENCODING'' to learn about that (or ''SET CLIENT_ENCODING'' to
change that)

- What is the locale of your client? (if it's on an unix-like system,
see above. Otherwise I have no idea).

Hope that helps
-- tomas


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFDh/xuBcgs9XrR2kYRAqypAJ9YWJc5rfJsCFlqzu3OWNqzIbgJeACf Zx7J
6eC2R6h6jqz4d5dyeuotbJ0=
=FosK
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 10:30 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2071: ERROR: invalid multibyte character for locale

tomas@tuxteam.de (Tomas Zerolo) writes:
> - What is the nevironment of the server process? That is: what does the
> shell command 'locale' say when it is issued in the same environment
> as the server starts? (that is not necessarily the environment you get
> if you start a shell!). Try, e.g. putting ''export LANG=us_US.UTF-8''
> just before the server is called (typically in /etc/init.d/postgresql
> or thereabout.


In recent PG versions you can do SHOW LC_COLLATE and/or SHOW LC_CTYPE
to verify the locale settings the server is using. Note that these are
locked down based on the environment seen by initdb --- you can't change
them just by inserting an environment setting into the postmaster start
script.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com