downcase_identifier(): use method table from locale provider - Mailing list pgsql-hackers

From Jeff Davis
Subject downcase_identifier(): use method table from locale provider
Date
Msg-id 5f95b81af1e81b28b8a9ac5929f199b2f4091fdf.camel@j-davis.com
Whole thread Raw
List pgsql-hackers
The attached patch refactors downcase_identifier() to use a method from
the locale provider.

The main advantage is that we can bring the tolower() call into the
libc provider, and make it tolower_l() to avoid the global LC_CTYPE
dependency. It's also generally aligned with the idea that provider-
specific behavior should be defined by the provider rather than the
caller, and might enable us in the future to improve support for
Unicode-aware identifier case folding.

Unfortunately, ICU also currently uses tolower() for single-byte
encodings, which seems to have been a historical oversight. This patch
doesn't correct that, which can be done in a separate patch.

There's a theoretical behavior change if downcase_identifier is called
before the database default locale is initialized, but I don't see a
practical problem there. Other than that, there should be no behavior
changes.

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: Skip unregistered custom kinds on stats load
Next
From: Nathan Bossart
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD