Refactor to add pg_strcoll(), pg_strxfrm(), and variants.
Jeff Davis <jdavis@postgresql.org>
Refactor to add pg_strcoll(), pg_strxfrm(), and variants. Offers a generally better separation of responsibilities for collation code. Also, a step towards multi-lib ICU, which should be based on a clean separation of the routines required for collation providers. Callers with NUL-terminated strings should call pg_strcoll() or pg_strxfrm(); callers with strings and their length should call the variants pg_strncoll() or pg_strnxfrm(). Reviewed-by: Peter Eisentraut, Peter Geoghegan Discussion: https://postgr.es/m/a581136455c940d7bd0ff482d3a2bd51af25a94f.camel%40j-davis.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/hash/hashfunc.c | modified | +34 −27 |
| src/backend/utils/adt/pg_locale.c | modified | +750 −19 |
| src/backend/utils/adt/varchar.c | modified | +27 −24 |
| src/backend/utils/adt/varlena.c | modified | +47 −321 |
| src/include/utils/pg_locale.h | modified | +13 −0 |
Discussion
- Rework of collation code, extensibility 24 messages · 2022-12-18 → 2023-02-23