Addition and subtraction on BIT type

From: Yasir Malik <ymalik(at)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:18:03
Message-ID: Pine.SGI.4.58.0311161117410.129151@guinness.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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ow 2003-11-16 19:22:45 WITHOUT OIDS by default
Previous Message Yasir Malik 2003-11-16 16:17:17 Addition and subtraction on BIT type