Re: Feature request for INITCAP() function

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Jeff Gerbracht <jeffgerbracht(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Feature request for INITCAP() function
Date: 2023-12-01 07:22:35
Message-ID: 72ab486d5074a96f5b68a20848a637573595737c.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2023-11-30 at 21:08 -0500, Jeff Gerbracht wrote:
> It would be great if there was a way to set exceptions to the 'word' delimiter list used in
> the INITCAP() function.    For example, I have hyphenated words like blue-green or
> possessives and contractions like don't and cat's tail
> These become Blue-Green, Don'T and Cat'S Tail.
>
> Being able to pass in a set of delimiter exceptions like hyphen and single quote would make
> this function much more useful for our specific use cases.

That would pretty quickly drift into locale-dependent rules. Such a function would be even
more special-case than the current "initcap()", which is already pretty specific to certain
languages. I don't know if there is enough value for the general public in it.

But it should be easy to implement it yourself, for example in PL/pgSQL. Why don't you
try that?

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jehan-Guillaume de Rorthais 2023-12-01 08:07:51 Re: PAF with Pacemaker
Previous Message Adrian Klaver 2023-12-01 05:19:28 Re: Two started cluster on the same data directory and port