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 987AC9DCC0D for ; Mon, 27 Mar 2006 15:13:23 -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 54077-03 for ; Mon, 27 Mar 2006 15:13:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 2B95F9DCA67 for ; Mon, 27 Mar 2006 15:13:18 -0400 (AST) Received: (qmail invoked by alias); 27 Mar 2006 19:13:19 -0000 Received: from dslb-084-063-035-143.pools.arcor-ip.net (EHLO colt.pezone.net) [84.63.35.143] by mail.gmx.net (mp027) with SMTP; 27 Mar 2006 21:13:19 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: pgsql-sql@postgresql.org Subject: Re: Bitfields always atomic? Other way to store attributes? Date: Mon, 27 Mar 2006 21:13:17 +0200 User-Agent: KMail/1.8.3 Cc: Bryce Nesbitt References: <44270BF6.6080109@obviously.com> In-Reply-To: <44270BF6.6080109@obviously.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603272113.17516.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.128 required=5 tests=[AWL=0.128] X-Spam-Score: 0.128 X-Spam-Level: X-Archive-Number: 200603/435 X-Sequence-Number: 24781 Bryce Nesbitt wrote: > 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 > must I wrap things in > explicit transactions? Each of these commands will be its own transaction if you don't explicitly start one. > My application is to give attributes to an address table. But maybe > there is a better way? Create 5 boolean fields. -- Peter Eisentraut http://developer.postgresql.org/~petere/