:: (colon colon sign) operator

Casts the value expr to the target data type type.

Syntax

expr :: type

Arguments

  • expr: Any castable expression.

Returns

The result is type type.

This operator is a synonym for cast(expr AS type) where you find a detailed description.

Examples

> SELECT '20.5'::INTEGER;
 20
> SELECT typeof(NULL::STRING);
 string