Re: Rework of collation code, extensibility

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Jeff Davis <pgsql@j-davis.com>, pgsql-hackers@postgresql.org
Date: 2023-01-11T14:08:46Z
Lists: pgsql-hackers
On 06.01.23 08:04, Jeff Davis wrote:
> The existing code is not great, in my opinion: it doesn't have clear
> API boundaries, the comments are insufficient, and lots of special
> cases need to be handled awkwardly by callers. That style is hard to
> beat when it comes to the raw line count; but it's quite difficult to
> understand and work on.
> 
> I think my changes are an improvement, but obviously that depends on
> the opinion of others who are working in this part of the code. What do
> you think?

I think the refactoring that you proposed in the thread "Refactor to 
introduce pg_strcoll()." was on a sensible track.  Maybe we should try 
to get that done.  The multiple-ICU stuff is still experimental and has 
its own rather impressive thread, so I don't think it's sensible to try 
to sort that out here.




Commits

  1. Remove unnecessary #ifdef USE_ICU and branch.

  2. Refactor to introduce pg_locale_deterministic().

  3. Refactor to add pg_strcoll(), pg_strxfrm(), and variants.

  4. Fix MSVC build