[lower()
](http://www.postgresql.org/docs/current/interactive/functions-
string.html#FUNCTIONS-STRING-SQL)/
upper()
使用其中之一将字符折叠为小写或大写。特殊字符不受影响:
SELECt count(*), lower(name), numberFROM tblGROUP BY lower(name), numberHAVINg count(*) > 1;
unaccent()
如果您实际上想忽略变音符号(如您的注释所暗示的那样),请安装附加模块
unaccent,该模块提供了一个文本搜索字典,该字典可以删除重音符号以及通用功能
unaccent():
CREATE EXTENSION unaccent;
使其非常简单:
SELECT lower(unaccent('B眉脽ercaf茅')) AS norm结果:
busercafe
这不会去除非字母。添加
regexp_replace()像@Craig提到的那样:
SELECT lower(unaccent(regexp_replace('$s^o&f!t B眉脽ercaf茅', 'W', '', 'g') )) AS norm结果:
softbusercafe



