X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6D21BD1D207 for ; Sun, 16 Nov 2003 16:17:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 67695-10 for ; Sun, 16 Nov 2003 12:17:19 -0400 (AST) Received: from heineken.cs.stevens-tech.edu (heineken.cs.stevens-tech.edu [155.246.89.69]) by svr1.postgresql.org (Postfix) with ESMTP id 67B20D1E1A0 for ; Sun, 16 Nov 2003 12:17:18 -0400 (AST) Received: from ymalik (helo=localhost) by heineken.cs.stevens-tech.edu with local-esmtp (Exim 3.35 #1 (Debian)) id 1ALPaP-000710-00 for ; Sun, 16 Nov 2003 11:17:17 -0500 Date: Sun, 16 Nov 2003 11:17:17 -0500 (EST) From: Yasir Malik To: pgsql-sql@postgresql.org Subject: Addition and subtraction on BIT type Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/237 X-Sequence-Number: 16052 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