{"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","derived_content_hash":"e6755dc2677fa20890bc368353a45f25c6a5a363182bbc6a484ba7121d8985ba","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"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:27a420f8c4bcbe06dbfffe65c365fb8a7372308cee85a12dbdefefad3336ba0e","receipt_sha256":"ddd5a83cd3c987f87e126285a51337e8415d227ea1432d8af6532879f11609f9","repair":"wiki-repair-20261023"},"signature":"encode ( bytes bytea, format text ) → text","signature_count":1,"slug":"encode","source_rev":"wiki-repair-20261023:19171a62684198f998b56cc2ca9ad1b9a43655ad6562e472c9d91c5206085f65","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":"wiki-repair-20261023:19171a62684198f998b56cc2ca9ad1b9a43655ad6562e472c9d91c5206085f65","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":"将二进制数据编码成文本表示；支持的 format 值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e 值为：\u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","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":"将二进制数据编码成文本表示；支持的 format 值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e 值为：\u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","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":"same-version-pgdoc"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-binarystring.html","sha256":"a98a1aec8735ec5efda751ce6130ddf7f9294aa38d0c0572205fff95132250b9"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-BINARYSTRING-CONVERSIONS","file":"functions-binarystring.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"encode","SourceDatabase":"center","Version":"18","Locale":"en","Title":"encode","Summary":"Encodes binary data into a textual representation; supported format values are: base64, escape, hex.","BodyHTML":"Encodes binary data into a textual representation; supported \u003cem\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e values are: \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":"wiki-repair-20261023:19171a62684198f998b56cc2ca9ad1b9a43655ad6562e472c9d91c5206085f65","ContentHash":"df3f151a897a3d90613d22ef2c9d89fac9b0eb5bb827314c586163d6b2b8a9b5","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.","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":"将二进制数据编码成文本表示；支持的 format 值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e 值为：\u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","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":"same-version-pgdoc"}]}},"RequestedLocale":"en","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":"将二进制数据编码成文本表示；支持的 format 值为：base64, escape, hex。","description_zh_html":"将二进制数据编码成文本表示；支持的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eformat\u003c/code\u003e\u003c/em\u003e 值为：\u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-BASE64\"\u003e\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-ESCAPE\"\u003e\u003ccode class=\"literal\"\u003eescape\u003c/code\u003e\u003c/a\u003e, \u003ca href=\"/zh/docs/18/functions-binarystring.html#ENCODE-FORMAT-HEX\"\u003e\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e\u003c/a\u003e。","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":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
