[BUGS] error reading c:\Program Files\PostgreSQL\8.3\data\postgresql.conf during installation
Package: One click installer of PostgreSQL 8.3 Env: Windows XP SP2 (Traditional Chinese) What's wrong: It says error reading c:\Program Files\PostgreSQL\8.3\data\postgresql.conf during installation. That data directory is empty. Obviously, you can't start the server later. Fix: This error is caused by the failure of initdb in creating a DB. It fails probably due to the locale. To fix the problem: runas /user:postgres cmd c: cd "\Program Files\PostgreSQL\8.3\bin" initdb -D "c:\Program Files\PostgreSQL\8.3\data" -E UTF8 --locale=English It is very important that you specify the encoding and the locale. Otherwise it will fail and report that the locale is invalid. -- Kent Tong SME accounting software package for just MOP30. See http://www.cpttm.org.mo/index_c.php?pg=cpttm/department/is/ispu/accsys/index.htm for more. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs
Re: [BUGS] BUG #1268: Two different Unicode chars are treated as
Tom Lane wrote: "PostgreSQL Bugs List" <[EMAIL PROTECTED]> writes: Description:Two different Unicode chars are treated as equal in a query This would be a matter to take up with the maintainer of your locale (which you didn't mention, but in any case it's a locale bug). We just do what strcoll() tells us. Thanks for the quick reply. The system locale is zh_TW.Big5. However, I've tried setting it to "C" but the test case still fails. In order to check if it's a locale bug, I've written a C program: #include #include #include int main() { char *s1 = "\xe4\xba\x8c"; char *s2 = "\xe4\xba\x94"; setlocale(LC_ALL, "en.UTF-8"); //setlocale(LC_ALL, "zh.Big5"); //doesn't make any difference printf("%d\n", strcoll(s1, s2)); return 0; } and compiled it and run it on that computer. It prints -1. It means that strcoll is working. > Note that it's possible this is a configuration error and not an > outright bug. Check to make sure that the locale you initdb'd > under is actually designed to work with UTF-8 data. Does it matter? The encoding provided to initdb is just a default for the databases to be created in the future. When I used createdb, I did specify "-E unicode". -- Kent Tong, Msc, MCSE, SCJP, CCSA, Delphi Certified Manager of IT Dept, CPTTM Authorized training for Borland, Cisco, Microsoft, Oracle, RedFlag & RedHat ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [BUGS] BUG #1268: Two different Unicode chars are treated as
Tom Lane wrote: Yes it does, and you missed the point. I said *locale*, not *encoding*. The LC_COLLATE and LC_CTYPE settings that prevail during initdb are fixed and not alterable without re-initdb. (I agree that this sucks, but that's how it is for now...) You're right. After using: initdb --locale zh_TW.utf8 /var/lib/pgsql/data then it works fine! Thanks again and sorry about any inconvenience. -- Kent Tong, Msc, MCSE, SCJP, CCSA, Delphi Certified Manager of IT Dept, CPTTM Authorized training for Borland, Cisco, Microsoft, Oracle, RedFlag & RedHat ---(end of broadcast)--- TIP 8: explain analyze is your friend
[BUGS] equal operator fails on two identical strings if initdb uses the traditional chinese locale
Hi, I'm running PostgreSQL v8 beta4 on Win2K. The default language selected in Win2K is Big5. I am using the Windows installer to install it. Everything is left as default except that the locale for initdb is set to "traditional-chinese". Here is a test (run in pgadmin III): 1. createdb db1 -E Unicode 2. psql db1 3. create table t1 ( s varchar(20) primary key ); 4. insert into t1 values('xyz'); Note that x, y and z are all Chinese characters. 5. select * from t1; It shows that record just fine. 6. select * from t1 where s='xyz'; It fails to find that record. 7. select * from t1 where s like 'xy%'; It finds that record. If I reinstall pgsql but leave the locale as the default ("C"), then the above test passes. BTW, the locale for traditional chinese in postgresql.conf is set to "traditional-chinese" literally. Shouldn't it be zh_TW? Thanks! ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [BUGS] equal operator fails on two identical strings if initdb
Peter Eisentraut wrote: Here is a test (run in pgadmin III): 1. createdb db1 -E Unicode Probably your locale does not support Unicode. You need to pick an encoding that matches your locale or vice versa. Is there any way to check? I have other programs reading and writing Unicode on this computer without problems. BTW, the locale for traditional chinese in postgresql.conf is set to "traditional-chinese" literally. Shouldn't it be zh_TW? That depends on what locale names the Windows operating system understands. Are you using the locale routines in mingw? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [BUGS] equal operator fails on two identical strings if initdb
Peter Eisentraut wrote: On a POSIX system, you can do $ LC_ALL= locale charmap and verify manually that the printed charmap (= character set encoding) matches what you use in PostgreSQL. I don't know whether an equivalent interface exists on Windows. Right, there is no such command. Reading and writing Unicode is not a problem. But if you run the string comparison operators, PostgreSQL passes the Unicode strings from your database to the operating system's collation routines, which will compare them thinking they are Big5 (or whatever) strings, which will result in the random behavior you observed. You need to set an appropriate locale so that the operating system also thinks they are in Unicode. You mean the OS fails to convert unicode strings to Big5 or the OS assumes the bytes are already in Big5? It is the locale used for initdb or the default system locale set in Windows that is used by the collation routines that you mentioned above? I just double checked my config and found that the default locale is US english. The "supported languages" are: * Traditional Chinese (default) * Simplified Chinese * Western Europe and United States. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org