PostgreSQL BIT_LENGTH() function

BIT_LENGTH() function

The PostgreSQL bit_length function is used to count the number of bits in a specified string.


 bit_length (str1)


Name Description
str1 A string whose BIT_LENGTH value is to be retrieved.

PostgreSQL Version: 9.3

Pictorial Presentation of PostgreSQL BIT_LENGTH() function

Pictorial presentation of PostgreSQL BIT_LENGTH()

Example: PostgreSQL BIT_LENGTH() function

The following PostgreSQL statement will return the length of the given string 'w3resource'' in bits, i.e. 80.


SELECT bit_length('w3resource') AS "bit_length";

Sample Output:

(1 row)

Previous: PostgreSQL String Functions Introduction
Next: CHAR_LENGTH function

Follow us on Facebook and Twitter for latest update.

We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook