{"Entry":{"collection":"func","key":"array-positions","name":"array_positions","aliases":[],"metadata":{"changed_in":["14"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.4","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.5"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":false,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":["array_positions ( anycompatiblearray, anycompatible ) → integer[]"],"removed":["array_positions ( anyarray, anyelement ) → integer[]"]},"status":"changed","to":"14"}],"content_hash":"31155f4bc113c4db10586df126b495b0a20bdd5f080329feaac44da904788e3e","first_version":"9.5","group":"array","group_label":"Array Functions And Operators","groups":["array"],"imported_at":"2026-09-14T21:49:48.832932+08:00","last_version":"20","name":"array_positions","name_key":"array_positions","position":19008,"present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","signature_count":1,"slug":"array-positions","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument.","summary_zh":""}},"Definition":{"Collection":"func","Key":"array-positions","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"array-positions","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using IS NOT DISTINCT FROM semantics, so it is possible to search for NULL. NULL is returned only if the array is NULL; if the value is not found in the array, an empty array is returned.","description_html":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using \u003ccode class=\"literal\"\u003eIS NOT DISTINCT FROM\u003c/code\u003e semantics, so it is possible to search for \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is returned only if the array is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e; if the value is not found in the array, an empty array is returned.","description_zh":"","description_zh_html":"","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":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using IS NOT DISTINCT FROM semantics, so it is possible to search for NULL. NULL is returned only if the array is NULL; if the value is not found in the array, an empty array is returned.","description_html":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using \u003ccode class=\"literal\"\u003eIS NOT DISTINCT FROM\u003c/code\u003e semantics, so it is possible to search for \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is returned only if the array is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e; if the value is not found in the array, an empty array is returned.","description_zh":"","description_zh_html":"","examples":[{"expr":"array_positions(ARRAY['A','A','B','A'], 'A')","result":"{1,2,4}"}],"html":"\u003ccode class=\"function\"\u003earray_positions\u003c/code\u003e ( \u003ccode class=\"type\"\u003eanycompatiblearray\u003c/code\u003e, \u003ccode class=\"type\"\u003eanycompatible\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger[]\u003c/code\u003e","returns":"integer[]","text":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"ARRAY-FUNCTIONS-TABLE","file":"functions-array.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"array-positions","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"array_positions","Summary":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用IS NOT DISTINCT FROM语义完成比较，所以可以搜索NULL。只有当数组为NULL时才返回NULL；如果在数组中没有找到该值，则返回空数组。","BodyHTML":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用\u003ccode\u003eIS NOT DISTINCT FROM\u003c/code\u003e语义完成比较，所以可以搜索\u003ccode\u003eNULL\u003c/code\u003e。只有当数组为\u003ccode\u003eNULL\u003c/code\u003e时才返回\u003ccode\u003eNULL\u003c/code\u003e；如果在数组中没有找到该值，则返回空数组。\u003cpre\u003earray_positions ( anycompatiblearray, anycompatible ) → integer[]\u003c/pre\u003e返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用\u003ccode\u003eIS NOT DISTINCT FROM\u003c/code\u003e语义完成比较，所以可以搜索\u003ccode\u003eNULL\u003c/code\u003e。只有当数组为\u003ccode\u003eNULL\u003c/code\u003e时才返回\u003ccode\u003eNULL\u003c/code\u003e；如果在数组中没有找到该值，则返回空数组。","SourceRevision":"ca936764","ContentHash":"dc12ed3347faf3c832f6a63f8ad5f947eb408cd2d845b8e90821e7862bcd1874","Payload":{"description_zh":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用IS NOT DISTINCT FROM语义完成比较，所以可以搜索NULL。只有当数组为NULL时才返回NULL；如果在数组中没有找到该值，则返回空数组。","description_zh_html":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用\u003ccode class=\"literal\"\u003eIS NOT DISTINCT FROM\u003c/code\u003e语义完成比较，所以可以搜索\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。只有当数组为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e时才返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e；如果在数组中没有找到该值，则返回空数组。","signatures":[{"description_zh":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用IS NOT DISTINCT FROM语义完成比较，所以可以搜索NULL。只有当数组为NULL时才返回NULL；如果在数组中没有找到该值，则返回空数组。","description_zh_html":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用\u003ccode class=\"literal\"\u003eIS NOT DISTINCT FROM\u003c/code\u003e语义完成比较，所以可以搜索\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。只有当数组为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e时才返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e；如果在数组中没有找到该值，则返回空数组。","returns":"integer[]","text":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"8ba93a6c9429e613d36caa9836692e020cffccbb8ef81c2512f4133d13c1a5f2","Text":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","Returns":"integer[]","Payload":{"description":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using IS NOT DISTINCT FROM semantics, so it is possible to search for NULL. NULL is returned only if the array is NULL; if the value is not found in the array, an empty array is returned.","description_html":"Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using \u003ccode class=\"literal\"\u003eIS NOT DISTINCT FROM\u003c/code\u003e semantics, so it is possible to search for \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is returned only if the array is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e; if the value is not found in the array, an empty array is returned.","description_zh":"","description_zh_html":"","examples":[{"expr":"array_positions(ARRAY['A','A','B','A'], 'A')","result":"{1,2,4}"}],"html":"\u003ccode class=\"function\"\u003earray_positions\u003c/code\u003e ( \u003ccode class=\"type\"\u003eanycompatiblearray\u003c/code\u003e, \u003ccode class=\"type\"\u003eanycompatible\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger[]\u003c/code\u003e","returns":"integer[]","text":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
