X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5861311F65DC for ; Tue, 28 Mar 2006 17:55:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23410-09 for ; Tue, 28 Mar 2006 17:55:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from dukecmmtar01.coxmail.com (dukecmmtar01.coxmail.com [68.99.120.48]) by postgresql.org (Postfix) with ESMTP id D5CC411F65CA for ; Tue, 28 Mar 2006 17:55:09 -0400 (AST) Received: from newton.gnova.com ([24.249.204.30]) by dukecmmtar01.coxmail.com (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060328215506.YWWP7208.dukecmmtar01.coxmail.com@newton.gnova.com>; Tue, 28 Mar 2006 16:55:06 -0500 Received: from newton.gnova.com (localhost.localdomain [127.0.0.1]) by newton.gnova.com (8.13.1/8.13.1) with ESMTP id k2SLt1kj007414; Tue, 28 Mar 2006 13:55:01 -0800 Received: (from apache@localhost) by newton.gnova.com (8.13.1/8.13.1/Submit) id k2SLt1kq007410; Tue, 28 Mar 2006 13:55:01 -0800 X-Authentication-Warning: newton.gnova.com: apache set sender to tjo@acm.org using -f Received: from 209.223.166.104 (SquirrelMail authenticated user tjo) by www.gnova.com with HTTP; Tue, 28 Mar 2006 13:55:01 -0800 (PST) Message-ID: <1066.209.223.166.104.1143582901.squirrel@www.gnova.com> Date: Tue, 28 Mar 2006 13:55:01 -0800 (PST) Subject: Re: Bitfields always atomic? Other way to store attributes? From: "TJ O'Donnell" To: In-Reply-To: <20060328202136.DE3541B8542@mx1.hub.org> References: <20060328202136.DE3541B8542@mx1.hub.org> X-Priority: 3 Importance: Normal Cc: Reply-To: tjo@acm.org X-Mailer: SquirrelMail (version 1.2.11) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.131 required=5 tests=[AWL=0.131] X-Spam-Score: 0.131 X-Spam-Level: X-Archive-Number: 200603/449 X-Sequence-Number: 24795 > If I have two threads modifying the same "bit" field: > thread1=> update table set bf=bf | '01000' > thread2=> update table set bf=bf | '10000' > Will this operation always be safe (e.g. result in bf='11000')? Or Won't this always result in bf='11xxx', depending on the original values of bf? TJ www.gnova.com