在MySQL中使用重音敏感主键 [英] Use accent senstive primary key in MySQL

查看:145
本文介绍了在MySQL中使用重音敏感主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySQL中具有重音敏感的主键.

Have an accent sensitive primary key in MySQL.

我有一个独特的单词表,所以我将单词本身用作主键(顺便说一句,如果有人可以给我一些建议,我不知道它是否是一个好的设计/实践).

I have a table of unique words, so I use the word itself as a primary key (by the way if someone can give me an advice about it, I have no idea if it's a good design/practice or not).

我需要使该字段具有重音(为什么不区分大小写),因为它必须区分例如法语动词"demander"的两个不同的变体形式的'demandé''demande'.我在数据库中存储重音词没有任何问题.我只是不能插入两个没有重音的重音字符串.

I need that field to be accent (and why not case) sensitive, because it must distinguish between, for instance, 'demandé' and 'demande', two different inflexions of the French verb "demander". I do not have any problem to store accented words in the database. I just can't insert two accented characters strings that are identical when unaccented.

在尝试使用以下查询创建'demandé'行时:

When trying to create the 'demandé' row with the following query:

INSERT INTO `corpus`.`token` (`name_token`) VALUES ('demandé');

我收到此错误:

ERROR 1062: 1062: Duplicate entry 'demandé' for key 'PRIMARY'

问题:

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