将不区分大小写的排序规则添加到PostgreSQL [英] Add case insensitive collation to PostgreSQL

查看:579
本文介绍了将不区分大小写的排序规则添加到PostgreSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,PostgreSQL没有大小写敏感的排序规则。它的文档描述了一种基于操作系统区域设置添加新排序规则的方法,例如:



http://www.postgresql.org/docs/9.1/static/sql-createcollat​​ion.html



但是



我的问题是:如何添加一个大小写对PostgreSQL服务器的敏感排序规则? b
$ b

有人能描述一个工作流吗?



我在网上找不到任何引用,有些人提到可能。
我使用v9.1进行测试 - 在Windows上是Debian GNU / Linux和v9.2。



只是为了说明我知道: / p>


  • PostgreSQL CITEXT 附加数据类型




这些不是我想要的解决方案。

解决方案

似乎不是可能在Postgres iteself内


不是从Postgres项目 - 只需使用
操作系统提供的归类。



By default, PostgreSQL comes without case insensitive collations. Its documentation describes a way to add new collations based on OS locales, e.g.:

http://www.postgresql.org/docs/9.1/static/sql-createcollation.html

however the created collations are case sensitive.

My question is: How to add a case INsensitive collation to a PostgreSQL server ?

Can somebody describe a workflow ?

I was not able to find any references on the net, while some people mention that it is possible. I've tested with v9.1 - Debian GNU/Linux and v9.2 on Windows.

Just to clarify that I'm aware of:

  • PostgreSQL CITEXT add-on data type
  • Usage of LOWER/UPPER for searches and indexes.

These are not the solutions that I want.

解决方案

Doesn't seem to be possible within Postgres iteself:

Not from the Postgres project -- we just use the collations supplied by the operating system.

这篇关于将不区分大小写的排序规则添加到PostgreSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆