{"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","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"],"signature":"json_serialize ( expression [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ] )","signature_count":1,"slug":"json-serialize","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"2026-09-14T13:14:25.684213+00:00@99e6866c","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\"\u003eRETURNING\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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"},"group":"json","group_label":"Json Functions And Operators","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\"\u003eRETURNING\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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-serialize","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_serialize","Summary":"将 SQL/JSON 表达式转换为字符或二进制字符串。expression可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的bytea。 RETURNING中使用的返回类型可以是任意字符串类型或bytea，默认为text。","BodyHTML":"将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的\u003ccode\u003ebytea\u003c/code\u003e。 \u003ccode\u003eRETURNING\u003c/code\u003e中使用的返回类型可以是任意字符串类型或\u003ccode\u003ebytea\u003c/code\u003e，默认为\u003ccode\u003etext\u003c/code\u003e。\u003cpre\u003ejson_serialize ( expression [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ] )\u003c/pre\u003e将 SQL/JSON 表达式转换为字符或二进制字符串。\u003cem\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e可以是任意 JSON 类型、任意字符串类型，或采用 UTF8 编码的\u003ccode\u003ebytea\u003c/code\u003e。 \u003ccode\u003eRETURNING\u003c/code\u003e中使用的返回类型可以是任意字符串类型或\u003ccode\u003ebytea\u003c/code\u003e，默认为\u003ccode\u003etext\u003c/code\u003e。","SourceRevision":"1b5ca64c","ContentHash":"b24de21311d6135cfba367bdf200581d6b833ac89549303e1544c9020588e645","Payload":{"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\"\u003eRETURNING\u003c/code\u003e中使用的返回类型可以是任意字符串类型或\u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为\u003ccode class=\"type\"\u003etext\u003c/code\u003e。","signatures":[{"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\"\u003eRETURNING\u003c/code\u003e中使用的返回类型可以是任意字符串类型或\u003ccode class=\"type\"\u003ebytea\u003c/code\u003e，默认为\u003ccode class=\"type\"\u003etext\u003c/code\u003e。","returns":"","text":"json_serialize ( expression [ FORMAT JSON [ ENCODING UTF8 ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ] )","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"5117ff719705cb8eb50438cb848343bfee8081e2cb893d6c37c6e91bbfae7391","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\"\u003eRETURNING\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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
