Home
Sign Up
Sign In
The Go Programming Language
›
http://golang.org/
›
Go Playground
Go Projects
›
Revel Web Framework
Advertisement
V2EX
›
Go 编程语言
PostgreSQL with Gorm 区分大小写的问题
hambman
·
Sep 17, 2020
· 2605 views
This topic created in 2130 days ago, the information mentioned may be changed or developed.
PostgreSQL 不区分大小写, 大家推荐的方案或者用 citext, 或者自定义的 validator
但是我用 gorm 作为 orm, 没有看到 gorm 的支持,请教大家。 @
jinzhu
gorm
postgresql
大小写
区分
2 replies
•
2020-09-17 23:55:02 +08:00
1
PopRain
Sep 17, 2020
看你写的,PostgreSQL 查询区分大小写,不支持大小写不敏感的查询,citext 是个“插件”,所以要加类型声明,否则查询效率很低,很多 orm 都不支持
2
hambman
OP
Sep 17, 2020
@
PopRain
是的,问题描述不太准确。暂时先用简单的办法,select * from foo where lower(username) = lower(key)
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
3009 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: d3e9c8b8 · 35ms ·
UTC 08:15
·
PVG 16:15
·
LAX 01:15
·
JFK 04:15
♥ Do have faith in what you're doing.
❯