Re: Camel case identifiers and folding

Поиск
Список
Период
Сортировка
От Morris de Oryx
Тема Re: Camel case identifiers and folding
Дата
Msg-id CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Camel case identifiers and folding  (Wim Bertels <wim.bertels@ucll.be>)
Ответы Re: Camel case identifiers and folding
Список pgsql-general
The original question has already been answered really well, but it reminds me to mention that Postgres text/varchar values are case-sensitive. Here's a list of the times when I would like a case-sensitive text field:

   Never

Now here's the list of times I would like a case-blind text field:

   Everywhere else.

If this is how you feel too, there are several alternatives. The one that I've chosen is to use the citext extension instead of text fields.This takes care of the problem without having to add extra function calls to your queries, do anything special with indexes, etc.

 If you have JSON, which has case-sensitive element names, use JSONB. 

Your requirements may differ than mine! Other people have good reason to want case-sensitive searches. I just never do. (30+ years in programming and I can't remember a time I wanted user data to be treated case-sensitively...but you never know...one day...maybe.) There's also an extension for stripping accents, which I've not needed.

I've idly wondered if using a different collation on a text field might be a better answer than using citext everywhere? If anyone wants to set me straight on this, I'd be grateful.



В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Conditional INSERT
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: Camel case identifiers and folding