Re: Fault with initcap

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Fault with initcap
Дата
Msg-id 10fbeda1-606a-553b-3598-eca814f40bb7@aklaver.com
обсуждение исходный текст
Ответ на Fault with initcap  (Shaozhong SHI <shishaozhong@gmail.com>)
Ответы Re: Fault with initcap  (Shaozhong SHI <shishaozhong@gmail.com>)
Список pgsql-general
On 10/12/21 09:31, Shaozhong SHI wrote:
> I tried initcap and found a major problem with it.

What Postgres version?

In version 12 and 14 I get:

> 
> Initcap of notemachine is NoteMachine.

select initcap('notemachine');
    initcap
-------------
  Notemachine

> 
> Initcap of Sainsbury's Bank is Sainsbury'S bank.

select initcap('Sainsbury''s Bank');
      initcap
------------------
  Sainsbury'S Bank


Which follows the definition here:

https://www.postgresql.org/docs/14/functions-string.html

initcap ( text ) → text

Converts the first letter of each word to upper case and the rest to 
lower case. Words are sequences of alphanumeric characters separated by 
non-alphanumeric characters.

> 
> This is not expected.

What is the encoding, collate, ctype for the database?

Can be found in psql using:

\l db_name

> 
> Anyway to get around this problem?
> 
> Regards,
> 
> David


-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: Avg/max size of these JSON docs in Postgres
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Aw: Re: Re: Fault with initcap