Data conversion in the S database and postgres Data Conversion
After s8.3, the default conversion between field data is canceled. If you need to perform data transformation, you can use ":" in the S database to convert the field data type. Actually, ":" is called.CAST function.Which fields can be converted into one another?
You only need to study the cast function to obtain the answer to this question. The cast function information is managed in the pg_cast table of the system.
The following table lists the types that can be converted at the current stage:
Source Type conversion target type
Int8 |
Int2 |
Int8 |
Int4 |
Int8 |
Float4 |
Int8 |
Float8 |
Int8 |
Numeric |
Int2 |
Int8 |
Int2 |
Int4 |
Int2 |
Float4 |
Int2 |
Float8 |
Int2 |
Numeric |
Int4 |
Int8 |
Int4 |
Int2 |
Int4 |
Float4 |
Int4 |
Float8 |
Int4 |
Numeric |
Float4 |
Int8 |
Float4 |
Int2 |
Float4 |
Int4 |
Float4 |
Float8 |
Float4 |
Numeric |
Float8 |
Int8 |
Float8 |
Int2 |
Float8 |
Int4 |
Float8 |
Float4 |
Float8 |
Numeric |
Numeric |
Int8 |
Numeric |
Int2 |
Numeric |
Int4 |
Numeric |
Float4 |
Numeric |
Float8 |
Int4 |
Bool |
Bool |
Int4 |
Int8 |
Oid |
Int2 |
Oid |
Oid |
Int8 |
Int8 |
Regproc |
Int2 |
Regproc |
Regproc |
Int8 |
Int8 |
Regprocedure |
Int2 |
Regprocedure |
Regprocedure |
Int8 |
Int8 |
Regogo |
Int2 |
Regogo |
Regogo |
Int8 |
Int8 |
Regoperator |
Int2 |
Regoperator |
Regoperator |
Int8 |
Int8 |
Regclass |
Int2 |
Regclass |
Regclass |
Int8 |
Int8 |
Regtype |
Int2 |
Regtype |
Regtype |
Int8 |
Int8 |
Regconfig |
Int2 |
Regconfig |
Regconfig |
Int8 |
Int8 |
Regdictionary |
Int2 |
Regdictionary |
Regdictionary |
Int8 |
Text |
Regclass |
Varchar |
Regclass |
Bpchar |
Text |
Bpchar |
Varchar |
Char |
Text |
Char |
Bpchar |
Char |
Varchar |
Name |
Text |
Name |
Bpchar |
Name |
Varchar |
Text |
Char |
Bpchar |
Char |
Varchar |
Char |
Text |
Name |
Bpchar |
Name |
Varchar |
Name |
Char |
Int4 |
Int4 |
Char |
Abstime |
Date |
Abstime |
Time |
Abstime |
Timestamp |
Abstime |
Timestamptz |
Reltime |
Interval |
Date |
Timestamp |
Date |
Timestamptz |
Time |
Interval |
Time |
Timetz |
Timestamp |
Abstime |
Timestamp |
Date |
Timestamp |
Time |
Timestamp |
Timestamptz |
Timestamptz |
Abstime |
Timestamptz |
Date |
Timestamptz |
Time |
Timestamptz |
Timestamp |
Timestamptz |
Timetz |
Interval |
Reltime |
Interval |
Time |
Timetz |
Time |
Lseg |
Point |
Path |
Point |
Path |
Polygon |
Box |
Point |
Box |
Lseg |
Box |
Polygon |
Box |
Circle |
Polygon |
Point |
Polygon |
Path |
Polygon |
Box |
Polygon |
Circle |
Circle |
Point |
Circle |
Box |
Circle |
Polygon |
Inet |
Cidr |
Int8 |
Bit |
Int4 |
Bit |
Bit |
Int8 |
Bit |
Int4 |
Cidr |
Text |
Inet |
Text |
Bool |
Text |
Text |
Xml |
Cidr |
Varchar |
Inet |
Varchar |
Bool |
Varchar |
Varchar |
Xml |
Cidr |
Bpchar |
Inet |
Bpchar |
Bool |
Bpchar |
Bpchar |
Xml |
Bpchar |
Bpchar |
Varchar |
Varchar |
Time |
Time |
Timestamp |
Timestamp |
Timestamptz |
Timestamptz |
Interval |
Interval |
Timetz |
Timetz |
Bit |
Bit |
Varbit |
Varbit |
Numeric |
Numeric |