{"Entry":{"collection":"func","key":"array-sort","name":"array_sort","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"17","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"18"}],"content_hash":"6b1bc41b3547d3e91daf8b35a9dbf6010540630a33fac1709dfff4c2d28ab6d4","derived_content_hash":"3d5782b74e4f903263d2c21d771569ce6e5d114d0835cadafdd0dd014fbee465","first_version":"18","group":"array","group_label":"Array Functions And Operators","groups":["array"],"imported_at":"2026-09-14T21:49:48.836543+08:00","last_version":"20","name":"array_sort","name_key":"array_sort","position":19015,"present_in":["18","19","20"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"53e45706eddb092f2707266385f3f2ee11a9b2b0569d799ad772b9eef1b9bc35","repair":"wiki-repair-20261023"},"signature":"array_sort ( array anyarray [, descending boolean [, nulls_first boolean ]] ) → anyarray","signature_count":1,"slug":"array-sort","source_rev":"wiki-repair-20261023:fd9be4b0a3c4f32c36e7bc110b46d52bda2b80202f8187d6a0a0494d6634479f","summary":"Sorts the first dimension of the array.","summary_zh":""}},"Definition":{"Collection":"func","Key":"array-sort","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"array-sort","SourceRevision":"wiki-repair-20261023:fd9be4b0a3c4f32c36e7bc110b46d52bda2b80202f8187d6a0a0494d6634479f","Facts":{"description":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","description_html":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e clause to the \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","description_zh":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 array 参数添加 COLLATE 子句来指定要使用的排序规则。","description_zh_html":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e 参数添加 \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e 子句来指定要使用的排序规则。","doc":{"anchor":"ARRAY-FUNCTIONS-TABLE","file":"functions-array.html","slug":"18"},"group":"array","group_label":"Array Functions And Operators","lang":"en","layout":"table-new","pages":["functions-array.html"],"prose_only":false,"signatures":[{"description":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","description_html":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e clause to the \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","description_zh":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 array 参数添加 COLLATE 子句来指定要使用的排序规则。","description_zh_html":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e 参数添加 \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e 子句来指定要使用的排序规则。","examples":[{"expr":"array_sort(ARRAY[[2,4],[2,1],[6,5]])","result":"{{2,1},{2,4},{6,5}}"}],"html":"\u003ccode class=\"function\"\u003earray_sort\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eanyarray\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003edescending\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003enulls_first\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003eanyarray\u003c/code\u003e","returns":"anyarray","text":"array_sort ( array anyarray [, descending boolean [, nulls_first boolean ]] ) → anyarray","zh_from":"same-version-pgdoc"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-array.html","sha256":"a25a0710e8f84e027ef945e85452074399887341e22d79542584f9c646b8f076"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"ARRAY-FUNCTIONS-TABLE","file":"functions-array.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"array-sort","SourceDatabase":"center","Version":"18","Locale":"en","Title":"array_sort","Summary":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","BodyHTML":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array\u0026#39;s element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode\u003eCOLLATE\u003c/code\u003e clause to the \u003cem\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","SourceRevision":"wiki-repair-20261023:fd9be4b0a3c4f32c36e7bc110b46d52bda2b80202f8187d6a0a0494d6634479f","ContentHash":"a4ddd37e5a9697fe80b1d3d66414da7a52a9edfeb82122c8b3ba1e7e15f4f774","Payload":{"description":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","description_html":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e clause to the \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","signatures":[{"description":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","description_html":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e clause to the \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","description_zh":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 array 参数添加 COLLATE 子句来指定要使用的排序规则。","description_zh_html":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e 参数添加 \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e 子句来指定要使用的排序规则。","examples":[{"expr":"array_sort(ARRAY[[2,4],[2,1],[6,5]])","result":"{{2,1},{2,4},{6,5}}"}],"html":"\u003ccode class=\"function\"\u003earray_sort\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eanyarray\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003edescending\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003enulls_first\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003eanyarray\u003c/code\u003e","returns":"anyarray","text":"array_sort ( array anyarray [, descending boolean [, nulls_first boolean ]] ) → anyarray","zh_from":"same-version-pgdoc"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"49a20fc4f40ab235f7cd1d41372d27bbbc11d00b47ee67c02cd2cc941c5d3def","Text":"array_sort ( array anyarray [, descending boolean [, nulls_first boolean ]] ) → anyarray","Returns":"anyarray","Payload":{"description":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a COLLATE clause to the array argument.","description_html":"Sorts the first dimension of the array. The sort order is determined by the default sort ordering of the array's element type; however, if the element type is collatable, the collation to use can be specified by adding a \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e clause to the \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e argument.","description_zh":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 array 参数添加 COLLATE 子句来指定要使用的排序规则。","description_zh_html":"对数组的第一维进行排序。排序顺序由数组元素类型的默认排序顺序决定；不过，如果元素类型支持排序规则，也可以通过给 \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e 参数添加 \u003ccode class=\"literal\"\u003eCOLLATE\u003c/code\u003e 子句来指定要使用的排序规则。","examples":[{"expr":"array_sort(ARRAY[[2,4],[2,1],[6,5]])","result":"{{2,1},{2,4},{6,5}}"}],"html":"\u003ccode class=\"function\"\u003earray_sort\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003earray\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eanyarray\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003edescending\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003enulls_first\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003eanyarray\u003c/code\u003e","returns":"anyarray","text":"array_sort ( array anyarray [, descending boolean [, nulls_first boolean ]] ) → anyarray","zh_from":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
