473,378 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

UNICODE-encoded database does not accept umlaut-characters.

Created a new 7.4 database.
# create database foo with encoding = UNICODE;
Then tried to restore my dump from pg 7.2 which was SQL-ASCII or Latin1
encoded (cant tell which of the two, only got the dump of the old database
left after upgrading postgresql.)
Succeeded creating the objects, but no data was restored, instead
postgresql complained about illegal UNICODE characters. Also export of an
MS-Access Database with pgAdmin 1.6 failed with the same errors.

Created a new database with encoding = Latin1. Everything worked fine.

This is a shame, as UNICODE was chosen to avoid future problems with exotic
characters. But I cant get it working because of this very problem!

Is this a bug? Any workarounds?

Regards & TIA
Erwin

--
no z in my mail.
Nov 22 '05 #1
3 4387
Erwin Brandstetter <Br***@gmzx.at> writes:
Created a new 7.4 database.
# create database foo with encoding = UNICODE;
Then tried to restore my dump from pg 7.2 which was SQL-ASCII or Latin1
encoded (cant tell which of the two, only got the dump of the old database
left after upgrading postgresql.)
Succeeded creating the objects, but no data was restored, instead
postgresql complained about illegal UNICODE characters.


Yeah; by default PG will assume that you are sending it UNICODE data
if that's what the database encoding is.

You can arrange for conversion to occur by adding
set client_encoding = latin1;
at the top of the dump file.

regards, tom lane

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

Nov 22 '05 #2
Hi Tom, hi NG!

Tom Lane wrote:
Yeah; by default PG will assume that you are sending it UNICODE data
if that's what the database encoding is.

You can arrange for conversion to occur by adding
set client_encoding = latin1;
at the top of the dump file.


First, thanx for the hint! Tried it, but no success. Here is what I did:

I altered my dump-file, so that it looks like this now:

--
-- pg_dumpall (7.2.1)
--
set client_encoding = latin1;

\connect template1
(...)

Then I created a new db cluster with initdb:

# initdb --encoding = UNICODE

Then I created each database, there was before, but now with UNICODE
encoding.
Then I tried to restore:

# psql template1 < my_dump_file
I got UNICODE errores again:
ERROR: Unicode characters greater than or equal to 0x10000 are not
supported
ERROR: invalid byte sequence for encoding "UNICODE": 0xe46e67
What am I doing wrong?
I am using the postgresql 7.4 debian woody backport, provided by Oliver
Elphick. That is, i was using it, i have messed it all up while trying to
reinstall - this goes into another post ..
Regards
Erwin Brandstetter

--
no z in my mail.
Nov 22 '05 #3
Erwin Brandstetter (myself) wrote in message
First, thanx for the hint! Tried it, but no success. Here is what I did:

(...)

After facing various problems with my installation of postgresql 7.4 I
decided to do a complete re-install (got strange errors when trying to
vacuum, for one).
Now, that finally everything is up and running again, I tried it again
the way Tom has pointed out to me, and .. voilá: it works. Goes off
without a hitch.

One hint, if u should be in a similar situation: Don't forget to set
client_encoding = Latin1 (or whatever is appropriate) for any client
client that does not make use of UNICODE.

Thanks once more to Tom & regards!
Erwin Brandstetter
Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
10
by: Larry Hastings | last post by:
I'm an indie shareware Windows game developer. In indie shareware game development, download size is terribly important; conventional wisdom holds that--even today--your download should be 5MB or...
5
by: wanghz | last post by:
Hello, everyone. I have a problem when I'm processing unicode strings. Is it possible to get the 8bit-string representation of any unicode string? Suppose I get a unicode string: a =...
1
by: maport | last post by:
The behavior of the unicode built-in function when given a unicode string seems a little odd to me: u'abc' Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: decoding...
13
by: gabor | last post by:
hi, from the documentation (http://docs.python.org/lib/os-file-dir.html) for os.listdir: "On Windows NT/2k/XP and Unix, if path is a Unicode object, the result will be a list of Unicode...
5
by: Holger Joukl | last post by:
Hi there, I consider the behaviour of unicode() inconvenient wrt to conversion of non-string arguments. While you can do: u'17.3' you cannot do:
2
by: John Nagle | last post by:
Regular expressions are compiled in ASCII mode unless Unicode mode is specified to "rc.compile". The difference is that regular expressions in ASCII mode don't recognize things like Unicode...
2
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually,...
5
by: =?Utf-8?B?Q3JhaWcgSm9obnN0b24=?= | last post by:
I am in the process of converting an application to Unicode that is built with Visual C++ .NET 2003. On application startup in debug mode I get an exception. The problem appears to be that code...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.