{"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","derived_content_hash":"90a7c7bcae77a7cf966513d20fecf8cf074612009ebd6ab1ac7d30166ad9186a","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"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"f75fc266da8deab2715f1f9816699e5faf7336e63a6d903eed4b6f919702d178","repair":"wiki-repair-20261023"},"signature":"array_positions ( anycompatiblearray, anycompatible ) → integer[]","signature_count":1,"slug":"array-positions","source_rev":"wiki-repair-20261023:7ca26ccd52fff627c64bd3a82b8395b40a99aa5d4e27b65419cb29ab0c478438","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":"wiki-repair-20261023:7ca26ccd52fff627c64bd3a82b8395b40a99aa5d4e27b65419cb29ab0c478438","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":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用 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；如果在数组中没有找到该值，则返回空数组。","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":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用 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；如果在数组中没有找到该值，则返回空数组。","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":"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-positions","SourceDatabase":"center","Version":"18","Locale":"en","Title":"array_positions","Summary":"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.","BodyHTML":"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\u003eIS NOT DISTINCT FROM\u003c/code\u003e semantics, so it is possible to search for \u003ccode\u003eNULL\u003c/code\u003e. \u003ccode\u003eNULL\u003c/code\u003e is returned only if the array is \u003ccode\u003eNULL\u003c/code\u003e; if the value is not found in the array, an empty array is returned.","SourceRevision":"wiki-repair-20261023:7ca26ccd52fff627c64bd3a82b8395b40a99aa5d4e27b65419cb29ab0c478438","ContentHash":"3efc4c330b994768154726111d56b1a7456bc49b1742255807b465323757a9db","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.","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":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用 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；如果在数组中没有找到该值，则返回空数组。","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":"same-version-pgdoc"}]}},"RequestedLocale":"en","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":"返回第二个参数在第一个参数所给数组中所有出现位置的下标数组。数组必须是一维的。使用 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；如果在数组中没有找到该值，则返回空数组。","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":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
