Home > Software design >  Difference between CREATE CAST and CREATE CONVERSION
Difference between CREATE CAST and CREATE CONVERSION

Time:05-24

In postgres, it seems there are two customizable ways to convert one value type into another via SQL, CREATE CONVERSION and CREATE CAST. What is the difference between these two items, for example what might be an example of where one might be used over another?

CodePudding user response:

A cast has nothing to do with a conversion.

A cast converts data from one data type to another, while a conversion converts a string from one encoding to another (and does not change the data type at all).

What you are looking for is a cast. Forget about the conversion.

  • Related