Re: Bitfields always atomic? Other way to store attributes?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Cc: Bryce Nesbitt <bryce1(at)obviously(dot)com>
Subject: Re: Bitfields always atomic? Other way to store attributes?
Date: 2006-03-27 19:13:17
Message-ID: 200603272113.17516.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Janning Vygen 2006-03-27 19:20:20 Re: Bitfields always atomic? Other way to store attributes?
Previous Message Bryce Nesbitt 2006-03-27 19:09:31 psqlODBC driver -- too many tables shown