Bitfields always atomic? Other way to store attributes?

Поиск
Список
Период
Сортировка
От Bryce Nesbitt
Тема Bitfields always atomic? Other way to store attributes?
Дата
Msg-id 44270BF6.6080109@obviously.com
обсуждение исходный текст
Ответы Re: Bitfields always atomic? Other way to store attributes?  (Peter Eisentraut <peter_e@gmx.net>)
Re: Bitfields always atomic? Other way to store attributes?  (Janning Vygen <vygen@gmx.de>)
Список pgsql-sql
Dear List;

If I have two threads modifying the same "bit" field:   thread1=> update table set bf=bf | '01000'   thread2=> update
tableset bf=bf | '10000'
 
Will this operation always be safe (e.g. result in bf='11000')?  Or must
I wrap things in
explicit transactions?

My application is to give attributes to an address table.  But maybe
there is a better way?

I want to mark each addresses with attributes, e.g. the person may be a
"friend", "on my holiday card list", "owe me money", be an "employee", a
"volunteer on the xxx project", or none of the above.

I could assign each role a bit.

Or, create a string field: "Friend,Money, Emp,VolXXX".

Or, create related tables:       friend_pk,         address_id       cardlist_pk,       address_id       money_pk,
 address_id,    amount_owed       volunteer_pk,    address_id
 

Any thoughts?
                       -Bryce Nesbitt
     

-- 
----
Visit http://www.obviously.com/




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem using set-returning functions
Следующее
От: Bryce Nesbitt
Дата:
Сообщение: psqlODBC driver -- too many tables shown