Re: Overlapping time ranges constraints in 8.4
От | Merlin Moncure |
---|---|
Тема | Re: Overlapping time ranges constraints in 8.4 |
Дата | |
Msg-id | CAHyXU0z5TFT6kMxwtmEWbTLX9rETjMqqqVJ5PxJEH1oWsnhvZg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Overlapping time ranges constraints in 8.4 ("EXT-Rothermel, Peter M" <Peter.M.Rothermel@boeing.com>) |
Список | pgsql-general |
On Mon, Aug 27, 2012 at 11:46 AM, EXT-Rothermel, Peter M <Peter.M.Rothermel@boeing.com> wrote: > I thought that this was going to be tricky. > > Perhaps I could use rules to populate a shadow table that is like a INNER JOIN of the two tables. This would consolidatethe Boolean on the separate table into the same table that holds the time ranges. In version 8.4 I would stillneed to use explicit locking on this shadow table but in 9.x an exclusion constraint may have a better chance of working. Are you expecting a lot of concurrent activity? If not, your best bet is probably to serialize all writes with an elevated lock. Barring that, you are probably going to have to write pending scheduling activity into a queue and have a subsequent transaction consume the queue and enforce the overlapping rules. Also, it's worth giving a quick shout to the upcoming 9.2 (which is going into release candidate status) range types feature for solving these types of problems. merlin
В списке pgsql-general по дате отправления: