From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Jeff Gerbracht <jeffgerbracht@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Feature request for INITCAP() function
Date: Fri, 01 Dec 2023 08:22:35 +0100
Message-ID: <72ab486d5074a96f5b68a20848a637573595737c.camel@cybertec.at> (raw)
In-Reply-To: <CAEwbS1R8pwhRkwRo3XsPt24ErBNtFWuReAZhVPJwA3oqo148tA@mail.gmail.com>
References: <CAEwbS1R8pwhRkwRo3XsPt24ErBNtFWuReAZhVPJwA3oqo148tA@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, jeffgerbracht@gmail.com
Subject: Re: Feature request for INITCAP() function
In-Reply-To: <72ab486d5074a96f5b68a20848a637573595737c.camel@cybertec.at>
References: <CAEwbS1R8pwhRkwRo3XsPt24ErBNtFWuReAZhVPJwA3oqo148tA@mail.gmail.com> <72ab486d5074a96f5b68a20848a637573595737c.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox