Re: Feature request for INITCAP() function - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Feature request for INITCAP() function
Date
Msg-id 72ab486d5074a96f5b68a20848a637573595737c.camel@cybertec.at
Whole thread Raw
In response to Feature request for INITCAP() function  (Jeff Gerbracht <jeffgerbracht@gmail.com>)
List 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



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Two started cluster on the same data directory and port
Next
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: PAF with Pacemaker