{"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","derived_content_hash":"604905f579010a7fdfc9db3b2c9bcd8c3472fd85afe75e549bd1c3da26ae6123","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:255d316243960b202055453c4effa612323cfdfbbfb22eef8e032ff2e44a8f4d","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:e04c783ba9b2f3e1218aa957e11d1fca44227fe5a3cb80d48ce58f16a2918ddd","receipt_sha256":"14c390857a85d2e3c02f0cc3fda6e4e8c04fce7e5cf133f8797d953c45ec1ad0","repair":"wiki-repair-20261023"},"signature":"array_to_json ( anyarray [, boolean ] ) → json","signature_count":1,"slug":"array-to-json","source_rev":"wiki-repair-20261023:255d316243960b202055453c4effa612323cfdfbbfb22eef8e032ff2e44a8f4d","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":"wiki-repair-20261023:255d316243960b202055453c4effa612323cfdfbbfb22eef8e032ff2e44a8f4d","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":"将 SQL 数组转换为 JSON 数组。该行为与 to_json 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将 SQL 数组转换为 JSON 数组。该行为与 \u003ccode class=\"function\"\u003eto_json\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 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":"将 SQL 数组转换为 JSON 数组。该行为与 to_json 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将 SQL 数组转换为 JSON 数组。该行为与 \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","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":"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":"array-to-json","SourceDatabase":"center","Version":"18","Locale":"en","Title":"array_to_json","Summary":"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.","BodyHTML":"Converts an SQL array to a JSON array. The behavior is the same as \u003ccode\u003eto_json\u003c/code\u003e except that line feeds will be added between top-level array elements if the optional boolean parameter is true.","SourceRevision":"wiki-repair-20261023:255d316243960b202055453c4effa612323cfdfbbfb22eef8e032ff2e44a8f4d","ContentHash":"89d2cc7a67d32251a6b35c4820688a030d7e66fd61c184840b0812b7efd0ed71","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.","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":"将 SQL 数组转换为 JSON 数组。该行为与 to_json 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将 SQL 数组转换为 JSON 数组。该行为与 \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","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":"same-version-manual"}]}},"RequestedLocale":"en","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":"32f38b4b6cc694c97ab47b2eadf974a58d8f1367f68ab022396c1f2101f1c0e0","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":"将 SQL 数组转换为 JSON 数组。该行为与 to_json 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","description_zh_html":"将 SQL 数组转换为 JSON 数组。该行为与 \u003ccode class=\"function\"\u003eto_json\u003c/code\u003e 相同，只是如果可选布尔参数为真，换行符将在顶级数组元素之间添加。","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":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
