Connecting Tech Pros Worldwide Help | Site Map

How to change character encoding of an existing database

Member
 
Join Date: Mar 2008
Posts: 35
#1: Mar 17 '08
Hi all,

Can I change the character encoding of an existing database. I have to store Unicode data in the database. Please help.

Regards,
Aradhana
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 292
#2: Mar 17 '08

re: How to change character encoding of an existing database


Quote:

Originally Posted by aradhanathawait

Hi all,

Can I change the character encoding of an existing database. I have to store Unicode data in the database. Please help.

Regards,
Aradhana

I'm not sure if it can be done (I didn't find that option in manual). Of course you can change the client encoding but it is not the same. You probably will have to
-dump all database
-create new with encoding you want
-restore dumped database
Member
 
Join Date: Mar 2008
Posts: 35
#3: Mar 17 '08

re: How to change character encoding of an existing database


Quote:

Originally Posted by rski

I'm not sure if it can be done (I didn't find that option in manual). Of course you can change the client encoding but it is not the same. You probably will have to
-dump all database
-create new with encoding you want
-restore dumped database


Thanx a lot. If I am creating a database using "creatdb" command then where to specify character encoding? Please tell me.
thanx & regards,
Aradhana
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 292
#4: Mar 17 '08

re: How to change character encoding of an existing database


Quote:

Originally Posted by aradhanathawait

Thanx a lot. If I am creating a database using "creatdb" command then where to specify character encoding? Please tell me.
thanx & regards,
Aradhana

Expand|Select|Wrap|Line Numbers
  1. createdb dbname -E encoding_you_want
  2.  
Member
 
Join Date: Mar 2008
Posts: 35
#5: Mar 18 '08

re: How to change character encoding of an existing database


Quote:

Originally Posted by rski

Expand|Select|Wrap|Line Numbers
  1. createdb dbname -E encoding_you_want
  2.  

Thank you now the database is storing data in Unicode but while querying the field it shows Hexadecimal codes of the characters starting with &#. Can't we see Hindi characters in the database?

Regards,
Aradhana
Reply


Similar PostgreSQL Database bytes