Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9247-00DcBQ-5y for pgsql-general@arkaria.postgresql.org; Fri, 01 Dec 2023 11:52:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r9245-007KKq-OK for pgsql-general@arkaria.postgresql.org; Fri, 01 Dec 2023 11:52:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9245-007KKi-Dk for pgsql-general@lists.postgresql.org; Fri, 01 Dec 2023 11:52:13 +0000 Received: from mail.verite.pro ([185.16.44.216]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r923y-009Wu0-FB for pgsql-general@lists.postgresql.org; Fri, 01 Dec 2023 11:52:12 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id 90DC78C06AD; Fri, 1 Dec 2023 12:52:04 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: Feature request for INITCAP() function To: "Jeff Gerbracht" Cc: pgsql-general@lists.postgresql.org In-Reply-To: Date: Fri, 01 Dec 2023 12:52:01 +0100 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. An ICU collation may produce better results for this: =20 select initcap('blue-green don''t cat''s tail' COLLATE "en-x-icu"); initcap=09=20=20=20=20=20 ----------------------------- Blue-Green Don't Cat's Tail With hyphens, it's not clear what the results should be. Looking at the IMDb movies database [1] for instance, titles have a mix of upper and lower case following the hyphen, even within the same english title: Hell-to-Pay Austin The Co-respondent A Pit-boy's Romance A Cowboy's Mother-in-Law Our Parents-In-Law The Good-for-Nothing When the Fire-Bells Rang The post-millennial wave ... [1] https://datasets.imdbws.com/ Best regards, --=20 Daniel V=E9rit=E9 https://postgresql.verite.pro/ Twitter: @DanielVerite