v.24.10Improvement
Allow empty needle in replace function for PostgreSQL compatibility
Allow empty needle in the function replace, the same behavior with PostgreSQL. #69918 (zhanglistar).Why it matters
This feature solves the inconsistency between ClickHouse and PostgreSQL where passing an empty string as the needle to thereplace function was previously unsupported or behaved differently. By allowing an empty needle, it improves compatibility and predictability for users migrating queries or working across both systems.How to use it
Simply use thereplace function with an empty string as the needle argument. For example:SELECT replace('clickhouse', '', 'x')This will now work as expected, similar to PostgreSQL's behavior.