我創建使用fr_CA.UTF-8我的數據庫是這樣的:問題PostgreSQL中訂購重音字符8.4
createdb --encoding=utf-8 --locale=fr_CA.UTF-8 --template=template0 someapp_development
然後我加載樣本數據,其中包含重音字符,其中包括「練習曲德我安德烈·卡倫」和「Zellers inc。」。在法國,E應該排序/ Z之前整理,因此我期待下面的語句:
SELECT fullname FROM addressees ORDER BY LOWER(fullname)
到Z之前返回E,但可悲的是,這種情況並非如此:
# select fullname from addressees where party_id in (36, 618, 1264, 2481, 4473) order by lower(fullname);
fullname
-------------------------------------------
VRV Express inc. [4473]
Vêtements S.P. Apparels inc. (Les) [2481]
Zellers inc. (Galeries Orford) [1264]
Étude de Me André Caron [618]
Étude de Me Richard Drapeau [36]
公告另外VRV在Vêtements之前。我一定在某個地方誤解了某些東西。一些更多的信息:
$ psql someapp_development
psql (8.4.4, server 8.4.3)
$ psql --list
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
---------------------------+-----------+----------+-------------+-------------+-----------------------
meetphil_development | francois | UTF8 | fr_CA.UTF-8 | fr_CA.UTF-8 |
我已閱讀HTTP:/ /stackoverflow.com/questions/1659158/converting-accented-characters-in-postgresql。這基本上是同一個問題嗎? –
是的,但是您可能想要在測試服務器上使用Postgres 9.0或9.1測試版進行測試,因爲從8.4開始,很多工作都進入了排序規則。事實上,我是99%,這將在9.1上工作,因爲他們在該版本中爲這個主題添加了整頁文檔。 –
我目前無法獲得9.1,但9.0.4無法解決問題。 –