to_hex()

一个将整数转换为十六进制的函数

to_hex() 是一个系统函数,用于将整数转换为其十六进制字符串等价物。

to_hex() 添加于 PostgreSQL 7.3

用法

to_hex ( integer ) → text
to_hex ( bigint ) → text

变更历史

示例

to_hex() 的基本用法示例

postgres=# SELECT to_hex(255);
 to_hex 
--------
 ff
(1 row)

bigint 转换为十六进制

postgres=# SELECT to_hex(-2401053088876216593);
      to_hex      
------------------
 deadbeefdeadbeef
(1 row)

分类

字符串操作, 系统函数

另请参阅

encode(), to_bin(), to_oct()

反馈

在此处提交有关“to_hex()”的任何评论、建议或更正 此处