Re: Initcap works differently with different locale providers

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Initcap works differently with different locale providers
Date: 2025-08-17 21:44:44
Message-ID: CAPpHfdvC2-kekJKi6L3+ZngBS2WFoTaAcxZ8ymSEd8UXakY+cg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Aug 6, 2025 at 9:21 PM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
>
> On Wed, 2025-08-06 at 13:44 +0200, Peter Eisentraut wrote:
> > It's meant to be an Oracle-compatible function, so maybe someone can
> > check there for some details.
>
> If it's purely a compatibility function, then using ICU's sophisticated
> word break iterator doesn't make sense.
>
> > https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/INITCAP.html
> >
> > I think we should try to document the behavior more precisely.
>
> I don't think ICU purely follows Unicode on this point (does it?), so
> we'd have to point to the ICU documentation.
>
> > But we
> > probably first have to agree what it should be.
>
> I still don't fully understand the use case here. I've used the
> function a few times to assemble a few strings into a page heading, but
> that was some time ago so I don't even clearly remember my use case. It
> seems plausible there are quite a few people doing something similar,
> and they'd benefit from ICU's more sophisticated approach.
>
> But if the primary use case is for compatibility, then we might be
> trying to hard to make this a provider-specific feature.

I'd like to propose a new version of patch. It includes specification
of behavior for each locale provider including particular ICU
function. Also it saves the note from upthread that initcap() is
intended for display convenience. What do you think about that?

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v4-0001-Further-clarify-documentation-for-the-initcap-fun.patch application/octet-stream 2.2 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Fujii Masao 2025-08-18 02:55:02 Re: Make pgoutput documentation easier to find
Previous Message Alexander Korotkov 2025-08-16 21:29:52 Re: Initcap works differently with different locale providers