{"Entry":{"collection":"func","key":"json-serialize","name":"json_serialize","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"16","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"17"}],"content_hash":"9d0fde3dbd65cbd92cd196b39ba401b21064303d4cc826d78e9501e7aaa956a9","derived_content_hash":"d6f293fe695d2548867a80ff556e49ce0c6045b209a372f49ec82923542eb5e3","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:4f35dc89d92024318def67dab4789e860cd24ee6fa4231388b69070efe24e9f1","versions":{"17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"17","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.79325+08:00","last_version":"20","name":"json_serialize","name_key":"json_serialize","position":16019,"present_in":["17","18","19","20"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"a0e5e57a8c5a5109831b58624067aae3d6a12eb0636e3c460a3074388be33b59","repair":"wiki-repair-20261023"},"signature":"json_serialize ( expression [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ] )","signature_count":1,"slug":"json-serialize","source_rev":"wiki-repair-20261023:4f35dc89d92024318def67dab4789e860cd24ee6fa4231388b69070efe24e9f1","summary":"Converts an SQL/JSON expression into a character or binary string.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-serialize","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-serialize","SourceRevision":"wiki-repair-20261023:4f35dc89d92024318def67dab4789e860cd24ee6fa4231388b69070efe24e9f1","Facts":{"description":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","description_html":"Converts an SQL/JSON expression into a character or binary string. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e. The default is \u003ccode class=\"type\"\u003etext\u003c/code\u003e.","description_zh":"将 SQL/JSON 表达式转换为字符或二进制字符串。expression 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 bytea。 RETURNING 中使用的返回类型可以是任意字符串类型或 bytea，默认为 text。","description_zh_html":"将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e。\u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e 中使用的返回类型可以是任意字符串类型或 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为 \u003ccode class=\"type\"\u003etext\u003c/code\u003e。","doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-json.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","version":"18.7"},{"file":"functions-json.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"31b98fa7f00387abf441728c31918bfe8b368642bceeb8bba88a73c3fbd607de","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"json","group_label":"JSON 函数和操作符","lang":"en","layout":"table-new","pages":["functions-json.html"],"prose_only":false,"signatures":[{"description":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","description_html":"Converts an SQL/JSON expression into a character or binary string. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e. The default is \u003ccode class=\"type\"\u003etext\u003c/code\u003e.","description_zh":"将 SQL/JSON 表达式转换为字符或二进制字符串。expression 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 bytea。 RETURNING 中使用的返回类型可以是任意字符串类型或 bytea，默认为 text。","description_zh_html":"将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e。\u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e 中使用的返回类型可以是任意字符串类型或 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为 \u003ccode class=\"type\"\u003etext\u003c/code\u003e。","examples":[{"expr":"json_serialize('{ \"a\" : 1 } ' RETURNING bytea)","result":"\\x7b20226122203a2031207d20"}],"html":"\u003ccode class=\"function\"\u003ejson_serialize\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eRETURNING\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edata_type\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] \u003c/span\u003e] )","returns":"","text":"json_serialize ( expression [FORMAT JSON [ENCODING UTF8] ] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] )","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-json.html","sha256":"a412feb14a229f1d9f14fa2d7735255aa297d5eb8f2971d744d9dfee659c7cca"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-serialize","SourceDatabase":"center","Version":"18","Locale":"en","Title":"json_serialize","Summary":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","BodyHTML":"Converts an SQL/JSON expression into a character or binary string. The \u003cem\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode\u003ebytea\u003c/code\u003e. The default is \u003ccode\u003etext\u003c/code\u003e.","SourceRevision":"wiki-repair-20261023:4f35dc89d92024318def67dab4789e860cd24ee6fa4231388b69070efe24e9f1","ContentHash":"5b53e2ea9d4ff202ff1a182e3c76376c31c82fc05da06ce89fb0984a2efc9075","Payload":{"description":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","description_html":"Converts an SQL/JSON expression into a character or binary string. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e. The default is \u003ccode class=\"type\"\u003etext\u003c/code\u003e.","signatures":[{"description":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","description_html":"Converts an SQL/JSON expression into a character or binary string. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e. The default is \u003ccode class=\"type\"\u003etext\u003c/code\u003e.","description_zh":"将 SQL/JSON 表达式转换为字符或二进制字符串。expression 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 bytea。 RETURNING 中使用的返回类型可以是任意字符串类型或 bytea，默认为 text。","description_zh_html":"将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e。\u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e 中使用的返回类型可以是任意字符串类型或 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为 \u003ccode class=\"type\"\u003etext\u003c/code\u003e。","examples":[{"expr":"json_serialize('{ \"a\" : 1 } ' RETURNING bytea)","result":"\\x7b20226122203a2031207d20"}],"html":"\u003ccode class=\"function\"\u003ejson_serialize\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eRETURNING\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edata_type\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] \u003c/span\u003e] )","returns":"","text":"json_serialize ( expression [FORMAT JSON [ENCODING UTF8] ] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] )","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"f5c97264b264d1d92519efe1983d6b07b966bad08e6fd459844beeee878632db","Text":"json_serialize ( expression [FORMAT JSON [ENCODING UTF8] ] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] )","Returns":"","Payload":{"description":"Converts an SQL/JSON expression into a character or binary string. The expression can be of any JSON type, any character string type, or bytea in UTF8 encoding. The returned type used in RETURNING can be any character string type or bytea. The default is text.","description_html":"Converts an SQL/JSON expression into a character or binary string. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e can be of any JSON type, any character string type, or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e in UTF8 encoding. The returned type used in \u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e can be any character string type or \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e. The default is \u003ccode class=\"type\"\u003etext\u003c/code\u003e.","description_zh":"将 SQL/JSON 表达式转换为字符或二进制字符串。expression 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 bytea。 RETURNING 中使用的返回类型可以是任意字符串类型或 bytea，默认为 text。","description_zh_html":"将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e 可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e。\u003ccode class=\"literal\"\u003e RETURNING\u003c/code\u003e 中使用的返回类型可以是任意字符串类型或 \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为 \u003ccode class=\"type\"\u003etext\u003c/code\u003e。","examples":[{"expr":"json_serialize('{ \"a\" : 1 } ' RETURNING bytea)","result":"\\x7b20226122203a2031207d20"}],"html":"\u003ccode class=\"function\"\u003ejson_serialize\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eRETURNING\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edata_type\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [\u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e] \u003c/span\u003e] \u003c/span\u003e] )","returns":"","text":"json_serialize ( expression [FORMAT JSON [ENCODING UTF8] ] [RETURNING data_type [FORMAT JSON [ENCODING UTF8] ] ] )","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
