{"Entry":{"collection":"func","key":"bit-length","name":"bit_length","aliases":[],"metadata":{"changed_in":["8.1"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"7.2"},{"descriptions_changed":true,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"7.3"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":["bit_length ( string ) → int"],"removed":["bit_length ( string ) → integer"]},"status":"changed","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"7dae20988e97cdcc75cd761e931c25581525794b12cc6f5c14a5c550a0445514","first_version":"7.2","group":"string","group_label":"String Functions And Operators","groups":["string","binarystring","bitstring"],"imported_at":"2026-09-27T17:57:28.309623+08:00","last_version":"20","name":"bit_length","name_key":"bit_length","position":3001,"present_in":["7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"bit_length ( text ) → integer","signature_count":3,"slug":"bit-length","source_rev":"b7bd9cda","summary":"Returns number of bits in the string (8 times the octet_length).","summary_zh":""}},"Definition":{"Collection":"func","Key":"bit-length","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"bit-length","SourceRevision":"b7bd9cda","Facts":{"description":"Returns number of bits in the string (8 times the octet_length).","description_html":"Returns number of bits in the string (8 times the \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e).","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-STRING-SQL","file":"functions-string.html","slug":"18"},"group":"string","group_label":"String Functions And Operators","lang":"en","layout":"table-new","pages":["functions-string.html","functions-binarystring.html","functions-bitstring.html"],"prose_only":false,"signatures":[{"description":"Returns number of bits in the string (8 times the octet_length).","description_html":"Returns number of bits in the string (8 times the \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length('jose')","result":"32"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( text ) → integer","zh_from":""},{"description":"Returns number of bits in the binary string (8 times the octet_length).","description_html":"Returns number of bits in the binary string (8 times the \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length('\\x123456'::bytea)","result":"24"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( bytea ) → integer","zh_from":""},{"description":"Returns number of bits in the bit string.","description_html":"Returns number of bits in the bit string.","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length(B'10111')","result":"5"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebit\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( bit ) → integer","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-STRING-SQL","file":"functions-string.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"bit-length","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"bit_length","Summary":"返回字符串中的位数（8倍于octet_length）。","BodyHTML":"返回字符串中的位数（8倍于\u003ccode\u003eoctet_length\u003c/code\u003e）。\u003cpre\u003ebit_length ( text ) → integer\u003c/pre\u003e返回字符串中的位数（8倍于\u003ccode\u003eoctet_length\u003c/code\u003e）。\u003cpre\u003ebit_length ( bytea ) → integer\u003c/pre\u003e返回二进制字符串中的位数（8 倍于 \u003ccode\u003eoctet_length\u003c/code\u003e）。\u003cpre\u003ebit_length ( bit ) → integer\u003c/pre\u003e返回位串中的位数。","SourceRevision":"ca936764","ContentHash":"49b6a8c80f2edac086fda79386d924a1da9792d0a4a52e8fbef6d0b489c6a04b","Payload":{"description_zh":"返回字符串中的位数（8倍于octet_length）。","description_zh_html":"返回字符串中的位数（8倍于\u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e）。","signatures":[{"description_zh":"返回字符串中的位数（8倍于octet_length）。","description_zh_html":"返回字符串中的位数（8倍于\u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e）。","returns":"integer","text":"bit_length ( text ) → integer","zh_from":"doc"},{"description_zh":"返回二进制字符串中的位数（8 倍于 octet_length）。","description_zh_html":"返回二进制字符串中的位数（8 倍于 \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e）。","returns":"integer","text":"bit_length ( bytea ) → integer","zh_from":"doc"},{"description_zh":"返回位串中的位数。","description_zh_html":"返回位串中的位数。","returns":"integer","text":"bit_length ( bit ) → integer","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"43d1d10b22f57614a9509d893ac9b746f3c3693026408fe02a035e6eb1f7bf7c","Text":"bit_length ( text ) → integer","Returns":"integer","Payload":{"description":"Returns number of bits in the string (8 times the octet_length).","description_html":"Returns number of bits in the string (8 times the \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length('jose')","result":"32"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( text ) → integer","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"9612041fdcf7330f475b9a7acf42581151b13bae4782b805edf733ec0889ce62","Text":"bit_length ( bytea ) → integer","Returns":"integer","Payload":{"description":"Returns number of bits in the binary string (8 times the octet_length).","description_html":"Returns number of bits in the binary string (8 times the \u003ccode class=\"function\"\u003eoctet_length\u003c/code\u003e).","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length('\\x123456'::bytea)","result":"24"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebytea\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( bytea ) → integer","zh_from":""}},{"Version":"18","Ordinal":2,"Hash":"fe6f5d903356f69f38dda9bf76002756bd5d8d1d9019a048d5886ae656357ef0","Text":"bit_length ( bit ) → integer","Returns":"integer","Payload":{"description":"Returns number of bits in the bit string.","description_html":"Returns number of bits in the bit string.","description_zh":"","description_zh_html":"","examples":[{"expr":"bit_length(B'10111')","result":"5"}],"html":"\u003ccode class=\"function\"\u003ebit_length\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebit\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"bit_length ( bit ) → integer","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
