Addition and subtraction on BIT type

From: Yasir Malik <ymalik(at)heineken(dot)cs(dot)stevens-tech(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Addition and subtraction on BIT type
Date: 2003-11-16 16:17:17
Message-ID: Pine.LNX.4.58.0311161108090.26810@heineken.cs.stevens-tech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,
Is there a way to do addition and subtraction on BIT types? For example,
for
creat table test (a BIT(3));
insert into test values (B'101');

select a + 1 from test; fails

and select a::smallint + 1 from test; also fails.

In addition, is there a way to change the bit of a bit string? For
example change a 1 to a 0 or vice versa.

Any suggestions?
Thanks,
Yasir

Browse pgsql-sql by date

  From Date Subject
Next Message Yasir Malik 2003-11-16 16:18:03 Addition and subtraction on BIT type
Previous Message Christopher Browne 2003-11-16 15:22:31 Re: Programatically switching database