Search Postgresql Archives

Need help with constraint to prevent overlaps

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

 



I'm building a shift-scheduling app.  I want to make a constraint in my
database that prevents one human from being assigned to work two
different jobs at the same time.

In other words, if I schedule John Doe to mop bathrooms from 10 AM until
4 PM, some other manager will not be able to schedule John Doe for a 1
PM meeting.

How can I do this with constraints?  Would I need to write a trigger
that does some 'select ... between ...' work?

I know I could do this in the python application code I am using on top
of postgres, but I really like putting as many constraints as possible
in my data model.

TIA

Matt



[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