Re: make tsearch use the database default locale
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: pgsql-hackers@postgresql.org
Date: 2025-10-15T20:43:58Z
Lists: pgsql-hackers
Attachments
- v3-0001-Add-pg_iswxdigit-useful-for-tsearch.patch (text/x-patch) patch v3-0001
- v3-0002-Add-pg_database_locale-to-retrieve-database-defau.patch (text/x-patch) patch v3-0002
- v3-0003-tsearch-use-database-default-collation-for-parsin.patch (text/x-patch) patch v3-0003
- v3-0004-Remove-obsolete-global-database_ctype_is_c.patch (text/x-patch) patch v3-0004
On Tue, 2025-10-07 at 15:49 -0700, Jeff Davis wrote: > This patch series allows tsearch to use the database default locale > for > parsing. If the database collation is libc, there's no change. I committed a couple of the refactoring patches and rebased. v3 attached. v3-0003 which eliminates the "wstr" logic and uses only the "pgwstr". I was a bit confused why both were needed, as the purpose of pg_wchar is to abstract away the problems with wchar_t. Perhaps it's historical, or perhaps I missed something. Regarding the risk of behavior changes: this affects parsing the values, but not the interpretation of values after parsing, so the risk of index inconsistencies seems low. There's risk that a document parsed in the old version would be parsed differently in the new version, though. Overall, it seems comparable to the risk of fb1a18810f. Regards, Jeff Davis
Commits
-
Make char2wchar() static.
- ff53907c3571 19 (unreleased) landed
-
Remove obsolete global database_ctype_is_c.
- 844385d12e75 19 (unreleased) landed
-
tsearch: use database default collation for parsing.
- e113f9c102b7 19 (unreleased) landed
-
Add pg_database_locale() to retrieve database default locale.
- e533524b23b8 19 (unreleased) landed
-
Add pg_iswxdigit(), useful for tsearch.
- 67a8b49e96ca 19 (unreleased) landed
-
Add pg_iswalpha() and related functions.
- af164f31b9f5 19 (unreleased) landed
-
pg_regc_locale.c: rename some static functions.
- 8efe982fe2c5 19 (unreleased) landed