Numeric Data Types

Numeric data types are numbers stored in database columns. These data types are typically grouped by:

Implicit casts from INTEGER, FLOAT, and NUMERIC to VARCHAR are not supported. If you need that functionality, write an explicit cast using one of the following forms:

CAST(x AS data-type-name) or x::data-type-name

The following example casts a float to an integer:

=> SELECT(FLOAT '123.5')::INT; 
 ?column?
----------
      124
(1 row)

String-to-numeric data type conversions accept formats of quoted constants for scientific notation, binary scaling, hexadecimal, and combinations of numeric-type literals: