Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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)
);


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux