Re: Initcap works differently with different locale providers
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>,
pgsql-docs@lists.postgresql.org
Date: 2025-08-17T21:44:44Z
Lists: pgsql-docs
Attachments
- v4-0001-Further-clarify-documentation-for-the-initcap-fun.patch (application/octet-stream) patch v4-0001
On Wed, Aug 6, 2025 at 9:21 PM Jeff Davis <pgsql@j-davis.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
Commits
-
Further clarify documentation for the initcap function
- f8ce9ed220b5 19 (unreleased) landed
-
Revert "Clarify documentation for the initcap function"
- 0edaaa8f2978 14.19 landed
- 06633271ec40 13.22 landed
- 098c27dee4c1 15.14 landed
- b862465dba33 16.10 landed
- 3b3aa1f651c7 17.6 landed
- 2ae8280d16c9 18.0 landed
-
Clarify documentation for the initcap function
- 907ac2ca30bb 13.22 landed
- 276b022ec05b 14.19 landed
- 9af075c4e27e 15.14 landed
- d861b9282261 16.10 landed
- 3c05d4d3433e 17.6 landed
- 1fe9e3822c4e 18.0 landed
- c2c2c7e22566 19 (unreleased) landed