Home > Archive > PostgreSQL Discussion > September 2005 > change db encoding?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author change db encoding?
Gábor Farkas

2005-09-27, 7:23 am

hi,

for historical reasons ;) (are there any other reasons),
we have a postgres db,
where the data are in iso-8859-15 encoding,
but the "database encoding" is iso-8859-1.

question(s):
1. is it possible to change the db-encoding?
2. if it remains like it is currently, when can there be problems?


thanks,
gabor

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

Peter Eisentraut

2005-09-27, 7:23 am

Am Dienstag, 27. September 2005 10:15 schrieb Gábor Farkas:
> for historical reasons ;) (are there any other reasons),
> we have a postgres db,
> where the data are in iso-8859-15 encoding,
> but the "database encoding" is iso-8859-1.
>
> question(s):
> 1. is it possible to change the db-encoding?


You can hack pg_database directly to change it. There shouldn't be a problem
in this case.

> 2. if it remains like it is currently, when can there be problems?


Problems will only occur for characters which are not in both -1 and -15. For
exampel, if you have text with a Euro symbol in your database, and the server
wants to recode it to a different encoding because, say, the client runs in
UTF-8, then you will get wrong output. So it's in your interest to fix this.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Gábor Farkas

2005-09-27, 7:23 am

Peter Eisentraut wrote:
> Am Dienstag, 27. September 2005 10:15 schrieb Gábor Farkas:
>
>
>
> Problems will only occur for characters which are not in both -1 and -15. For
> exampel, if you have text with a Euro symbol in your database, and the server
> wants to recode it to a different encoding because, say, the client runs in
> UTF-8, then you will get wrong output. So it's in your interest to fix this.


so only at re-encoding?

i'm asking because right now it works fine (yes, even for those chars
that are different between -1 and -15).

in other words, could you tell me a test-case when an error might happen?

thanks,
gabor

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com