{"Entry":{"collection":"func","key":"bit-count","name":"bit_count","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"14"}],"content_hash":"0f795c9b0e579872a9db4cb6579e915e1e1bfdc28b2af2d80e3be05e9de3834a","first_version":"14","group":"binarystring","group_label":"Binary String Functions And Operators","groups":["binarystring","bitstring"],"imported_at":"2026-09-14T21:49:48.681406+08:00","last_version":"20","name":"bit_count","name_key":"bit_count","position":4000,"present_in":["14","15","16","17","18","19","20"],"signature":"bit_count ( bytes bytea ) → bigint","signature_count":2,"slug":"bit-count","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Returns the number of bits set in the binary string (also known as “popcount”).","summary_zh":""}},"Definition":{"Collection":"func","Key":"bit-count","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"bit-count","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Returns the number of bits set in the binary string (also known as “popcount”).","description_html":"Returns the number of bits set in the binary string (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e).","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-BINARYSTRING-OTHER","file":"functions-binarystring.html","slug":"18"},"group":"binarystring","group_label":"Binary String Functions And Operators","lang":"en","layout":"table-new","pages":["functions-binarystring.html","functions-bitstring.html"],"prose_only":false,"signatures":[{"description":"Returns the number of bits set in the binary string (also known as “popcount”).","description_html":"Returns the number of bits set in the binary string (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_count('\\x1234567890'::bytea)","result":"15"}],"html":"\u003ccode class=\"function\"\u003ebit_count\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebytes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"bit_count ( bytes bytea ) → bigint","zh_from":""},{"description":"Returns the number of bits set in the bit string (also known as “popcount”).","description_html":"Returns the number of bits set in the bit string (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_count(B'10111')","result":"4"}],"html":"\u003ccode class=\"function\"\u003ebit_count\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebit\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"bit_count ( bit ) → bigint","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-BINARYSTRING-OTHER","file":"functions-binarystring.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"bit-count","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"bit_count","Summary":"返回二进制字符串中被置位的位数（也称为“popcount”）。","BodyHTML":"返回二进制字符串中被置位的位数（也称为\u003cspan\u003e“\u003cspan\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。\u003cpre\u003ebit_count ( bytes bytea ) → bigint\u003c/pre\u003e返回二进制字符串中被置位的位数（也称为\u003cspan\u003e“\u003cspan\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。\u003cpre\u003ebit_count ( bit ) → bigint\u003c/pre\u003e返回位串中被置位的位数（也称为\u003cspan\u003e“\u003cspan\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。","SourceRevision":"ca936764","ContentHash":"e44f3ac9d7ed1bb2a8e7627cd1029adf9f1021949fc32bbd4350a9ee4e1cc69d","Payload":{"description_zh":"返回二进制字符串中被置位的位数（也称为“popcount”）。","description_zh_html":"返回二进制字符串中被置位的位数（也称为\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。","signatures":[{"description_zh":"返回二进制字符串中被置位的位数（也称为“popcount”）。","description_zh_html":"返回二进制字符串中被置位的位数（也称为\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。","returns":"bigint","text":"bit_count ( bytes bytea ) → bigint","zh_from":"doc"},{"description_zh":"返回位串中被置位的位数（也称为“popcount”）。","description_zh_html":"返回位串中被置位的位数（也称为\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e）。","returns":"bigint","text":"bit_count ( bit ) → bigint","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"24f678da386ae02b08b14e02e8013d04a5402a5740f706d992d9732107ad1107","Text":"bit_count ( bytes bytea ) → bigint","Returns":"bigint","Payload":{"description":"Returns the number of bits set in the binary string (also known as “popcount”).","description_html":"Returns the number of bits set in the binary string (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_count('\\x1234567890'::bytea)","result":"15"}],"html":"\u003ccode class=\"function\"\u003ebit_count\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebytes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"bit_count ( bytes bytea ) → bigint","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"e9e8e030205767521dd62f23aa89add8f9b5857d8b8f7104db4c24e486ce82f0","Text":"bit_count ( bit ) → bigint","Returns":"bigint","Payload":{"description":"Returns the number of bits set in the bit string (also known as “popcount”).","description_html":"Returns the number of bits set in the bit string (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epopcount\u003c/span\u003e”\u003c/span\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_count(B'10111')","result":"4"}],"html":"\u003ccode class=\"function\"\u003ebit_count\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebit\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"bit_count ( bit ) → bigint","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
