{"Entry":{"collection":"func","key":"array-to-json","name":"array_to_json","aliases":[],"metadata":{"changed_in":["9.3","9.4"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.2"},{"descriptions_changed":false,"doc_overhaul":false,"from":"9.2","group_changed":null,"signatures":{"added":["array_to_json ( anyarray [, pretty_bool] ) → json"],"removed":["array_to_json ( anyarray [, pretty_bool] )"]},"status":"changed","to":"9.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":["array_to_json ( anyarray [, pretty_bool] )"],"removed":["array_to_json ( anyarray [, pretty_bool] ) → json"]},"status":"changed","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"14"}],"content_hash":"51ffc365cb4dbab7b6cec808e690f8dd5226adf5bb2a4ee312e74565f0c810b1","first_version":"9.2","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.779066+08:00","last_version":"20","name":"array_to_json","name_key":"array_to_json","position":16000,"present_in":["9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"array_to_json ( anyarray [, boolean ] ) → json","signature_count":1,"slug":"array-to-json","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Converts an SQL array to a JSON array.","summary_zh":""}},"Definition":{"Collection":"func","Key":"array-to-json","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"array-to-json","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Converts an SQL array to a JSON array. The behavior is the same as to_json except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","description_html":"Converts an SQL array to a JSON array. The behavior is the same as \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","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 array to a JSON array. The behavior is the same as to_json except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","description_html":"Converts an SQL array to a JSON array. The behavior is the same as \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","description_zh":"","description_zh_html":"","examples":[{"expr":"array_to_json('{{1,5},{99,100}}'::int[])","result":"[[1,5],[99,100]]"}],"html":"\u003ccode class=\"function\"\u003earray_to_json\u003c/code\u003e ( \u003ccode class=\"type\"\u003eanyarray\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"array_to_json ( anyarray [, boolean ] ) → json","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"array-to-json","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"array_to_json","Summary":"将SQL数组转换为JSON数组。该行为与to_json相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","BodyHTML":"将SQL数组转换为JSON数组。该行为与\u003ccode\u003eto_json\u003c/code\u003e相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。\u003cpre\u003earray_to_json ( anyarray [, boolean ] ) → json\u003c/pre\u003e将SQL数组转换为JSON数组。该行为与\u003ccode\u003eto_json\u003c/code\u003e相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","SourceRevision":"1b5ca64c","ContentHash":"21b5ce582b034f7c1312ac62717edf92ac84ca451055850501e9047cb5612cc0","Payload":{"description_zh":"将SQL数组转换为JSON数组。该行为与to_json相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将SQL数组转换为JSON数组。该行为与\u003ccode class=\"function\"\u003eto_json\u003c/code\u003e相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","signatures":[{"description_zh":"将SQL数组转换为JSON数组。该行为与to_json相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将SQL数组转换为JSON数组。该行为与\u003ccode class=\"function\"\u003eto_json\u003c/code\u003e相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","returns":"json","text":"array_to_json ( anyarray [, boolean ] ) → json","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"1780f990bc6675f4e645ed4d77b25a095b332d833d7cf9eb91763c4eb8ff5da2","Text":"array_to_json ( anyarray [, boolean ] ) → json","Returns":"json","Payload":{"description":"Converts an SQL array to a JSON array. The behavior is the same as to_json except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","description_html":"Converts an SQL array to a JSON array. The behavior is the same as \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","description_zh":"","description_zh_html":"","examples":[{"expr":"array_to_json('{{1,5},{99,100}}'::int[])","result":"[[1,5],[99,100]]"}],"html":"\u003ccode class=\"function\"\u003earray_to_json\u003c/code\u003e ( \u003ccode class=\"type\"\u003eanyarray\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"array_to_json ( anyarray [, boolean ] ) → json","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
