Re: Camel case identifiers and folding

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Camel case identifiers and folding
Дата
Msg-id 7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com
обсуждение исходный текст
Ответ на Re: Camel case identifiers and folding  (Morris de Oryx <morrisdeoryx@gmail.com>)
Ответы Re: Camel case identifiers and folding
Re: Camel case identifiers and folding
Список pgsql-general


On Mar 15, 2019, at 4:43 PM, Morris de Oryx <morrisdeoryx@gmail.com> wrote:

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.



What sort of content is in your field of type text?  Certainly, in English prose, “rob” is different than “Rob” and if the content is for a web page (or in my experience, the content of medical reference books) these differences are critical.

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

Предыдущее
От: Morris de Oryx
Дата:
Сообщение: Re: Camel case identifiers and folding
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: Conditional INSERT