You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ANSI SQL allows to create user-defined types. See 11.51 <user-defined type definition>.
Nevertheless, Tarantool doesn't support this feature yet, but we can use this statement at least for creating type aliases: CREATE TYPE AGE_TYPE AS INTEGER;
This feature may be useful taking into consideration user-defined CAST operator: if user wants to use custom casting rules, but don't want to break it for all usages of given type, one can create alias for that type and define CAST operator.
For instance, user is willing to ban conversion from FLOAT to INT:
CREATE TYPE NEW_INT AS INTEGER;
CREATE CAST (float AS NEW_INT) WITH FUNCTION new_int_cast(NEW_INT) AS ASSIGNMENT;
In this example new_int_cast() function would throw error indicating the fact that conversion is not allowed.
The text was updated successfully, but these errors were encountered:
ANSI SQL allows to create user-defined types. See 11.51 <user-defined type definition>.
Nevertheless, Tarantool doesn't support this feature yet, but we can use this statement at least for creating type aliases:
CREATE TYPE AGE_TYPE AS INTEGER;
This feature may be useful taking into consideration user-defined CAST operator: if user wants to use custom casting rules, but don't want to break it for all usages of given type, one can create alias for that type and define CAST operator.
For instance, user is willing to ban conversion from FLOAT to INT:
In this example new_int_cast() function would throw error indicating the fact that conversion is not allowed.
The text was updated successfully, but these errors were encountered: