User-defined casts

A user-defined cast is a cast that you define to perform conversion from one UDT to another data type, either built-in or user-defined. You can create user-defined casts to perform conversions between most data types, including opaque types, distinct types, row types, and built-in types.