v.20.11New Feature
Added toUUIDOrNull and toUUIDOrZero Cast Functions
AddedtoUUIDOrNull,toUUIDOrZerocast functions. #16337 (Maksim Kita).
Why it matters
These functions provide safer type casting by returningNULL or a zero UUID instead of throwing an error when conversion to UUID fails. This improves data processing robustness and simplifies error handling in queries involving UUID conversions.How to use it
Use the functions in your SQL queries like this:SELECT toUUIDOrNull(column) FROM table;
SELECT toUUIDOrZero(column) FROM table;They attempt to cast input to UUID and return
NULL or a zero UUID respectively if conversion is not possible.