Data Type Functions and Operators

to_bin(source int4)

Returns the binary representation of integer.

Parameters:source – source value
Return type:text
Example:
select to_bin(22);
> 10110
to_char(source int8, format text)

Convert integer to string.

Parameters:
  • source – source value
  • format – format
Return type:

text

Example:
select to_char(125, '00999');
> 00125
to_hex(source int4)

Convert the argument to hexadecimal.

Parameters:source – source value
Return type:text
Example:
select to_hex(15);
> F