如何在Postgres的文本列中添加唯一约束(忽略特殊字符?)>
CREATE TABLE my_table( SomeTextColumn citext CONSTRAINT person_u_1 UNIQUE (SomeTextColumn) );
在上表中,我试图添加一个唯一约束,该约束将通过忽略传入数据中的特殊字符来查找唯一性
For example:
1. HelloWorld --> Gets inserted successfully
2. Hello World --> Should fail with duplicate constraint
2. Hello%$^&*W^%orld --> Should fail with duplicate constraint
如何在Postgres的文本列中添加唯一约束(忽略特殊字符?创建表my_table(SomeTextColumn citext CONSTRAINT person_u_1 UNIQUE(SomeTextColumn));在...
您可以创建实现检查的unique
索引: