{"Entry":{"collection":"func","key":"encode","name":"encode","aliases":[],"metadata":{"changed_in":["8.4"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"7.2"},{"descriptions_changed":true,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"7.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"8.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"8.2"},{"descriptions_changed":true,"doc_overhaul":false,"from":"8.3","group_changed":null,"signatures":{"added":["encode ( data bytea, format text ) → text"],"removed":["encode ( data bytea, type text ) → text","encode ( string bytea, type text ) → text"]},"status":"changed","to":"8.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":{"from":"string","to":"binarystring"},"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"19"}],"content_hash":"c2c1bdf84a9c3a1d8dcb0347aea97ef637d9c0f70a68265442b8f679f067eb0e","first_version":"7.2","group":"binarystring","group_label":"Binary String Functions And Operators","groups":["string","binarystring"],"imported_at":"2026-09-27T17:57:28.476186+08:00","last_version":"20","name":"encode","name_key":"encode","position":4007,"present_in":["7.2","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":"encode ( bytes bytea, format text ) → text","signature_count":1,"slug":"encode","source_rev":"b7bd9cda","summary":"Encodes binary data into a textual representation; supported format values are: base32hex, base64, base64url, escape, hex.","summary_zh":""}},"Definition":{"Collection":"func","Key":"encode","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"encode","SourceRevision":"b7bd9cda","Facts":{"description":"Encodes binary data into a textual representation; supported format values are: base64, escape, hex.","description_html":"Encodes binary data into a textual representation; supported \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e values are: \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-BINARYSTRING-CONVERSIONS","file":"functions-binarystring.html","slug":"18"},"group":"binarystring","group_label":"Binary String Functions And Operators","lang":"en","layout":"table-new","pages":["functions-binarystring.html"],"prose_only":false,"signatures":[{"description":"Encodes binary data into a textual representation; supported format values are: base64, escape, hex.","description_html":"Encodes binary data into a textual representation; supported \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e values are: \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"encode('123\\000\\001', 'base64')","result":"MTIzAAE="}],"html":"\u003ccode class=\"function\"\u003eencode\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebytes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"encode ( bytes bytea, format text ) → text","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-BINARYSTRING-CONVERSIONS","file":"functions-binarystring.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"encode","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"encode","Summary":"将二进制数据编码成文本表示；支持的format值为：base64, escape, hex。","BodyHTML":"将二进制数据编码成文本表示；支持的\u003cem\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e值为：\u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\" rel=\"nofollow\"\u003e\u003ccode\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\" rel=\"nofollow\"\u003e\u003ccode\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\" rel=\"nofollow\"\u003e\u003ccode\u003ehex\u003c/code\u003e\u003c/a\u003e。\u003cpre\u003eencode ( bytes bytea, format text ) → text\u003c/pre\u003e将二进制数据编码成文本表示；支持的\u003cem\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e值为：\u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\" rel=\"nofollow\"\u003e\u003ccode\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\" rel=\"nofollow\"\u003e\u003ccode\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\" rel=\"nofollow\"\u003e\u003ccode\u003ehex\u003c/code\u003e\u003c/a\u003e。","SourceRevision":"ca936764","ContentHash":"6ef02f0062b759d9de9dfe8fe748a2d643f63982f079cf65c5a2a94caaaf60c0","Payload":{"description_zh":"将二进制数据编码成文本表示；支持的format值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的\u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e值为：\u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","signatures":[{"description_zh":"将二进制数据编码成文本表示；支持的format值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的\u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e值为：\u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","returns":"text","text":"encode ( bytes bytea, format text ) → 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.2","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":"8c40e0fcbb79a376b20336edf3a3b02325a6349b001ccf85864ddbadc1589957","Text":"encode ( bytes bytea, format text ) → text","Returns":"text","Payload":{"description":"Encodes binary data into a textual representation; supported format values are: base64, escape, hex.","description_html":"Encodes binary data into a textual representation; supported \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e values are: \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"encode('123\\000\\001', 'base64')","result":"MTIzAAE="}],"html":"\u003ccode class=\"function\"\u003eencode\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebytes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"encode ( bytes bytea, format text ) → text","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
