Skip site navigation (1) Skip section navigation (2)

Bit string manipulation in Postgresql

From: Ericson Smith <ericson(at)did-it(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Bit string manipulation in Postgresql
Date: 2002-10-30 01:01:26
Message-ID: 1035939687.26937.7.camel@linux (view raw or flat)
Thread:
Lists: pgsql-admin
Hi all,

I'm trying to code a problem where a set of options can be expressed in
a data column like "10111011", a bit string. 

Each position is atomic and represents a certain setting within the set,
thus: "00100000" would return TRUE if OR'd with "10111011", since the
3'rd position matches in both sets.

While I could manually retrieve N records and iterate through them in
whatever programming language (or possibly a plpgsql function), is there
a way I could natively do this in a WHERE clause in my query? 

Looking through the idocs, I could not immediately find a way around
this issue. Any pointers to documentation (or perhaps another way to
implement this issue) would be very helpful.

Regards
Ericson Smith
eric(at)did-it(dot)com




Responses

pgsql-admin by date

Next:From: mallahDate: 2002-10-30 04:03:35
Subject: Re: user functions
Previous:From: Fco. Javier Murillo RuízDate: 2002-10-30 00:49:56
Subject: user functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group