Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)

Поиск
Список
Период
Сортировка
От Gavin Wahl
Тема Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)
Дата
Msg-id CAAAf5g9HLMvk4zfrLZjWkkeCD15MvL4cEMr-SjLqtvrTTb__ZA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
> Given this limited example I'd probably choose to model notifications as an
> array on the user table.  Then just "UPDATE user SET notifications =
> array['a','b']::text WHERE user_id = 1;

I'm hesitant to ditch the first normal form just to get around this. Anyway,
there's actually extra data in the table that makes it hard to use an array:

CREATE TABLE notifications (
  user_id INT,
  type CHAR(1),
  threshold INT,
  some_options BOOLEAN,
  PRIMARY KEY (user_id, type)
);


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] Concurrency-safe Replacing a Set of Rows (Without SERIALIZABLE)