| От | Tom Lane |
|---|---|
| Тема | Re: Case Insensitive CHECK CONSTRAINTs |
| Дата | |
| Msg-id | 7463.984600594@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Case Insensitive CHECK CONSTRAINTs (Shaw Terwilliger <sterwill@sourcegear.com>) |
| Список | pgsql-general |
Shaw Terwilliger <sterwill@sourcegear.com> writes:
> I have a table with a TEXT field called "username". I'd like to retain the=
> =20
> case of the data stored here, but I'd like all comparisons to be done witho=
> ut
> regard to case. Since all these accesses _should_ be done through database=
> =20
> functions, I can simply lower() the input values and compare. I also have
> an index created on lower(username), so lookups are quick.
> However, I'd also like to have some sort of table constraint to make sure=
> =20
> alternate case "duplicate" records don't creep into the table. Any tips?
Make that index be UNIQUE.
BTW, please don't send HTML-coded mail to the lists. It's a pain in the
neck to quote.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера