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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Bitfields always atomic? Other way to store attributes?
Дата
Msg-id 200603272113.17516.peter_e@gmx.net
обсуждение исходный текст
Ответ на Bitfields always atomic? Other way to store attributes?  (Bryce Nesbitt <bryce1@obviously.com>)
Список 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 по дате отправления:

Предыдущее
От: Bryce Nesbitt
Дата:
Сообщение: psqlODBC driver -- too many tables shown
Следующее
От: Janning Vygen
Дата:
Сообщение: Re: Bitfields always atomic? Other way to store attributes?