diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 68fe6a95b49..1d3429fbd9c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -4013,6 +4013,28 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three'); <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm> + <primary>bit_count</primary> + </indexterm> + <indexterm> + <primary>popcount</primary> + <see>bit_count</see> + </indexterm> + <function>bit_count</function> ( <parameter>bytes</parameter> <type>bytea</type> ) + <returnvalue>bigint</returnvalue> + </para> + <para> + Returns the number of bits set in the binary string (also known as + <quote>popcount</quote>). + </para> + <para> + <literal>bit_count('\x1234567890'::bytea)</literal> + <returnvalue>31</returnvalue> + </para></entry> + </row> + + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm> <primary>btrim</primary> </indexterm> <function>btrim</function> ( <parameter>bytes</parameter> <type>bytea</type>, @@ -4717,6 +4739,24 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three'); <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm> + <primary>bit_count</primary> + </indexterm> + <function>bit_count</function> ( <type>bit</type> ) + <returnvalue>bigint</returnvalue> + </para> + <para> + Returns the number of bits set in the bit string (also known as + <quote>popcount</quote>). + </para> + <para> + <literal>bit_count(B'10111')</literal> + <returnvalue>4</returnvalue> + </para></entry> + </row> + + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm> <primary>bit_length</primary> </indexterm> <function>bit_length</function> ( <type>bit</type> ) |