↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / String Functions And Operators

Converts the number to its equivalent two's complement hexadecimal representation.

Reading PG 18current·documented in 25 of 27 versions, 7.3 to 20

Signatures & examples

to_hex ( integer ) → text
Converts the number to its equivalent two's complement hexadecimal representation.
to_hex(2147483647) → 7fffffff
to_hex(-1234) → fffffb2e
to_hex ( bigint ) → text
Converts the number to its equivalent two's complement hexadecimal representation.
to_hex(2147483647) → 7fffffff
to_hex(-1234) → fffffb2e
Version history 4
  1. 16 → 17 changed
  2. 12 → 13 changed
  3. 8.0 → 8.1 changed
  4. 7.2 → 7.3 added

Definition snapshot: b7bd9cda · English manual source