{"Entry":{"collection":"func","key":"json-array","name":"json_array","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"16"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"19"}],"content_hash":"6ef624de1ec0097fe8a7b9017dda657300678f098a31efc221a9fdaaded3f3ae","first_version":"16","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.781321+08:00","last_version":"20","name":"json_array","name_key":"json_array","position":16002,"present_in":["16","17","18","19","20"],"signature":"json_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","signature_count":2,"slug":"json-array","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-array","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-array","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column. If ABSENT ON NULL is specified, NULL values are ignored. This is always the case if a query_expression is used.","description_html":"Constructs a JSON array from either a series of \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e parameters or from the results of \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e, which must be a SELECT query returning a single column. If \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified, NULL values are ignored. This is always the case if a \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e is used.","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":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column. If ABSENT ON NULL is specified, NULL values are ignored. This is always the case if a query_expression is used.","description_html":"Constructs a JSON array from either a series of \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e parameters or from the results of \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e, which must be a SELECT query returning a single column. If \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified, NULL values are ignored. This is always the case if a \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e is used.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_array(1,true,json '{\"a\":null}')","result":"[1, true, {\"a\":null}]"},{"expr":"json_array(SELECT * FROM (VALUES(1),(2)) t)","result":"[1, 2]"}],"html":"\u003ccode class=\"function\"\u003ejson_array\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e{ \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e\u003c/span\u003e ] } [\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e | \u003ccode class=\"literal\"\u003eABSENT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eON NULL\u003c/code\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_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":""},{"description":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column. If ABSENT ON NULL is specified, NULL values are ignored. This is always the case if a query_expression is used.","description_html":"Constructs a JSON array from either a series of \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e parameters or from the results of \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e, which must be a SELECT query returning a single column. If \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified, NULL values are ignored. This is always the case if a \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e is used.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_array(1,true,json '{\"a\":null}')","result":"[1, true, {\"a\":null}]"},{"expr":"json_array(SELECT * FROM (VALUES(1),(2)) t)","result":"[1, 2]"}],"html":"\u003ccode class=\"function\"\u003ejson_array\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\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_array ( [ query_expression ] [ 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-array","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_array","Summary":"从一系列value_expression参数或query_expression的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了ABSENT ON NULL，则忽略 NULL 值。使用query_expression时始终如此。","BodyHTML":"从一系列\u003cem\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。\u003cpre\u003ejson_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])\u003c/pre\u003e从一系列\u003cem\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。\u003cpre\u003ejson_array ( [ query_expression ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])\u003c/pre\u003e从一系列\u003cem\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。","SourceRevision":"1b5ca64c","ContentHash":"0d5173edb4f0d907473c2ad2827e6d0e8c03780fd7b06614864af6280efa6565","Payload":{"description_zh":"从一系列value_expression参数或query_expression的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了ABSENT ON NULL，则忽略 NULL 值。使用query_expression时始终如此。","description_zh_html":"从一系列\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。","signatures":[{"description_zh":"从一系列value_expression参数或query_expression的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了ABSENT ON NULL，则忽略 NULL 值。使用query_expression时始终如此。","description_zh_html":"从一系列\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。","returns":"","text":"json_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":"doc"},{"description_zh":"从一系列value_expression参数或query_expression的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了ABSENT ON NULL，则忽略 NULL 值。使用query_expression时始终如此。","description_zh_html":"从一系列\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e参数或\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e的结果构造 JSON 数组；后者必须是返回单列的 SELECT 查询。如果指定了\u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e，则忽略 NULL 值。使用\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e时始终如此。","returns":"","text":"json_array ( [ query_expression ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"3e3ee4c26d9c378f4e9312d3831cdde4e143ef30764d4fa7a5752a16de570100","Text":"json_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","Returns":"","Payload":{"description":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column. If ABSENT ON NULL is specified, NULL values are ignored. This is always the case if a query_expression is used.","description_html":"Constructs a JSON array from either a series of \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e parameters or from the results of \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e, which must be a SELECT query returning a single column. If \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified, NULL values are ignored. This is always the case if a \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e is used.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_array(1,true,json '{\"a\":null}')","result":"[1, true, {\"a\":null}]"},{"expr":"json_array(SELECT * FROM (VALUES(1),(2)) t)","result":"[1, 2]"}],"html":"\u003ccode class=\"function\"\u003ejson_array\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e{ \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e\u003c/span\u003e ] } [\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e | \u003ccode class=\"literal\"\u003eABSENT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eON NULL\u003c/code\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_array ( [ { value_expression [ FORMAT JSON ] } [, ...] ] [ { NULL | ABSENT } ON NULL ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"3ef977e10cdb822bd8a83751f977e0499c296d816f855887612a04833cc73307","Text":"json_array ( [ query_expression ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","Returns":"","Payload":{"description":"Constructs a JSON array from either a series of value_expression parameters or from the results of query_expression, which must be a SELECT query returning a single column. If ABSENT ON NULL is specified, NULL values are ignored. This is always the case if a query_expression is used.","description_html":"Constructs a JSON array from either a series of \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e parameters or from the results of \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e, which must be a SELECT query returning a single column. If \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified, NULL values are ignored. This is always the case if a \u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\u003e is used.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_array(1,true,json '{\"a\":null}')","result":"[1, true, {\"a\":null}]"},{"expr":"json_array(SELECT * FROM (VALUES(1),(2)) t)","result":"[1, 2]"}],"html":"\u003ccode class=\"function\"\u003ejson_array\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003equery_expression\u003c/code\u003e\u003c/em\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_array ( [ query_expression ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
