{"Entry":{"collection":"func","key":"to-hex","name":"to_hex","aliases":[],"metadata":{"changed_in":["8.1"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"7.3"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":["to_hex ( number int or bigint ) → text"],"removed":["to_hex ( number integer or bigint ) → text"]},"status":"changed","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"16","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"17"}],"content_hash":"89c6161c61354ea7e7ce8cd89efad51954fa4acee579f945b73152a7080b92d3","first_version":"7.3","group":"string","group_label":"String Functions And Operators","groups":["string"],"imported_at":"2026-09-27T17:57:28.448119+08:00","last_version":"20","name":"to_hex","name_key":"to_hex","position":3051,"present_in":["7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"to_hex ( integer ) → text","signature_count":2,"slug":"to-hex","source_rev":"b7bd9cda","summary":"Converts the number to its equivalent two's complement hexadecimal representation.","summary_zh":""}},"Definition":{"Collection":"func","Key":"to-hex","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"to-hex","SourceRevision":"b7bd9cda","Facts":{"description":"Converts the number to its equivalent two's complement hexadecimal representation.","description_html":"Converts the number to its equivalent two's complement hexadecimal representation.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-STRING-OTHER","file":"functions-string.html","slug":"18"},"group":"string","group_label":"String Functions And Operators","lang":"en","layout":"table-new","pages":["functions-string.html"],"prose_only":false,"signatures":[{"description":"Converts the number to its equivalent two's complement hexadecimal representation.","description_html":"Converts the number to its equivalent two's complement hexadecimal representation.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_hex(2147483647)","result":"7fffffff"},{"expr":"to_hex(-1234)","result":"fffffb2e"}],"html":"\u003ccode class=\"function\"\u003eto_hex\u003c/code\u003e ( \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"to_hex ( integer ) → text","zh_from":""},{"description":"Converts the number to its equivalent two's complement hexadecimal representation.","description_html":"Converts the number to its equivalent two's complement hexadecimal representation.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_hex(2147483647)","result":"7fffffff"},{"expr":"to_hex(-1234)","result":"fffffb2e"}],"html":"\u003ccode class=\"function\"\u003eto_hex\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"to_hex ( bigint ) → text","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-STRING-OTHER","file":"functions-string.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"to-hex","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"to_hex","Summary":"将数字转换为等价的十六进制补码表示。","BodyHTML":"将数字转换为等价的十六进制补码表示。\u003cpre\u003eto_hex ( integer ) → text\u003c/pre\u003e将数字转换为等价的十六进制补码表示。\u003cpre\u003eto_hex ( bigint ) → text\u003c/pre\u003e将数字转换为等价的十六进制补码表示。","SourceRevision":"1b5ca64c","ContentHash":"a171b36a0de30f6cbc08368c5e80cc1e4aba1c0ce846ff48663d0643568bc3b3","Payload":{"description_zh":"将数字转换为等价的十六进制补码表示。","description_zh_html":"将数字转换为等价的十六进制补码表示。","signatures":[{"description_zh":"将数字转换为等价的十六进制补码表示。","description_zh_html":"将数字转换为等价的十六进制补码表示。","returns":"text","text":"to_hex ( integer ) → text","zh_from":"doc"},{"description_zh":"将数字转换为等价的十六进制补码表示。","description_zh_html":"将数字转换为等价的十六进制补码表示。","returns":"text","text":"to_hex ( bigint ) → text","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"fb872cdb26a2e0adeaf72b85776b21b0d485dda3c22b0d6fc862555a5e448df3","Text":"to_hex ( integer ) → text","Returns":"text","Payload":{"description":"Converts the number to its equivalent two's complement hexadecimal representation.","description_html":"Converts the number to its equivalent two's complement hexadecimal representation.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_hex(2147483647)","result":"7fffffff"},{"expr":"to_hex(-1234)","result":"fffffb2e"}],"html":"\u003ccode class=\"function\"\u003eto_hex\u003c/code\u003e ( \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"to_hex ( integer ) → text","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"922245321d80cb86dfe315dd9df733b633696a8fb97922ce6051cd3db1572ad9","Text":"to_hex ( bigint ) → text","Returns":"text","Payload":{"description":"Converts the number to its equivalent two's complement hexadecimal representation.","description_html":"Converts the number to its equivalent two's complement hexadecimal representation.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_hex(2147483647)","result":"7fffffff"},{"expr":"to_hex(-1234)","result":"fffffb2e"}],"html":"\u003ccode class=\"function\"\u003eto_hex\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"to_hex ( bigint ) → text","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
