Bit String Manipulation - Mailing list pgsql-general

From psql-mail@freeuk.com
Subject Bit String Manipulation
Date
Msg-id E19ognD-000Obh-00@buckaroo.freeuk.net
Whole thread Raw
List pgsql-general
Hi, I am having problems manipulating bit strings.

CREATE TABLE lookup(
fname TEXT PRIMARY KEY,
digest BIT VARYING
);

I am trying to construct another bit string based on the length of the
first:

SELECT b'1'::bit( bit_length( digest ) ) FROM lookup;

This doesn't work as i had hoped, where am I going wrong?

Thanks!

pgsql-general by date:

Previous
From: Johann Uhrmann
Date:
Subject: Performance with different index types
Next
From: Jason Godden
Date:
Subject: Re: C vs plpgsql and child processes