The dmetaphone() SQL function internally upper-cases the argument string. It did this using the toupper() function. That way, it has a dependency on the global LC_CTYPE locale setting, which we want to get rid of. The "double metaphone" algorithm specifically supports the "C with cedilla" letter, so just using ASCII case conversion wouldn't work. To fix that, use the passed-in collation and use the str_toupper() function, which has full awareness of collations and collation providers. Note that this does not change the fact that this function only works correctly with single-byte encodings. The change to str_toupper() makes the case conversion multibyte-enabled, but the rest of the function is still not ready. Reviewed-by: Jeff Davis <pgsql@j-davis.com> Discussion: https://www.postgresql.org/message-id/108e07a2-0632-4f00-984d-fe0e0d0ec726%40eisentraut.org
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.