BerntB has asked for the wisdom of the Perl Monks concerning the following question:
I read about i18n settings (initdb for P-sql, etc) and it looked easy. show all; in psql shows lc_collate eq en_US.UTF-8.
It doesn't even work for 7-bit ASCII strings! PostgreSQL ignores case and spaces (in strings -- not only postfix?!). Spaces inside strings are needed in some cases, so I can't just repack everything.
I saw that the "C" locale should sort on spaces, but then it won't sort i18n char sets correctly.
I use the standard Ubuntu P-SQL and Perl for this simple test.
A common sorting problem like this should either be very simple or discussed in lots of places. Since I can't seem to find those discussions, I'm missing something obvious? :-)
Update: Fixed language after I slept. :-)
Update 2: Ported to MySQL 5 and Collation works well, even supports case sensitivity (if I want it). My tests also run noticeably faster (with InnoDB). PostgreSQL seems behind MySQL in sql standard support in this area.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Postgresql and space characters
by cdarke (Prior) on Sep 17, 2006 at 09:03 UTC | |
by BerntB (Deacon) on Sep 17, 2006 at 12:03 UTC | |
|
Re: Postgresql and space characters
by gellyfish (Monsignor) on Sep 17, 2006 at 08:51 UTC | |
by BerntB (Deacon) on Sep 17, 2006 at 11:57 UTC | |
|
Re: Postgresql and space characters
by graff (Chancellor) on Sep 17, 2006 at 22:14 UTC | |
by BerntB (Deacon) on Sep 18, 2006 at 00:43 UTC | |
by graff (Chancellor) on Sep 18, 2006 at 03:52 UTC | |
by BerntB (Deacon) on Sep 18, 2006 at 09:27 UTC |