9.3. General Conversion Rules

Any data type conversion whether done implicitly, or done explicitly by casting or conversion functions must obey the following rules.

When the target is an integer type (SMALLINT, INTEGER, BIGINT)

When the target is a floating point type (REAL, DOUBLE PRECISION)

When the target is the NUMERIC data type

When the target is a character data type (CHAR, VARCHAR, TEXT)

When the target is a timestamp data type (DATE, TIMESTAMP)