Re: Bitfields always atomic? Other way to store attributes? - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Bitfields always atomic? Other way to store attributes?
Date
Msg-id 200603272113.17516.peter_e@gmx.net
Whole thread Raw
In response to Bitfields always atomic? Other way to store attributes?  (Bryce Nesbitt <bryce1@obviously.com>)
List pgsql-sql
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/


pgsql-sql by date:

Previous
From: Bryce Nesbitt
Date:
Subject: psqlODBC driver -- too many tables shown
Next
From: Janning Vygen
Date:
Subject: Re: Bitfields always atomic? Other way to store attributes?