Re: [SQL] check for overlapping time intervals

2013-04-22 Thread Wolfgang Meiners
Am 22.04.13 12:36, schrieb Thomas Kellerer: > Wolfgang Meiners, 22.04.2013 12:19: >> Is there a simpler way to check for overlapping timeintervals? I ask >> this question, because i have more similar tables with similar layout >> and would have to write similar functions again and again. > > Do yo

Re: [SQL] check for overlapping time intervals

2013-04-22 Thread Thomas Kellerer
Wolfgang Meiners, 22.04.2013 12:19: Is there a simpler way to check for overlapping timeintervals? I ask this question, because i have more similar tables with similar layout and would have to write similar functions again and again. Do you have the possibility to upgrade to 9.2? The range typ

[SQL] check for overlapping time intervals

2013-04-22 Thread Wolfgang Meiners
Hi, I am on postgresql 9.1 and use at table like CREATE TABLE timetable( tid INTEGER PRIMARY KEY, gid INTEGER REFERENCES groups(gid), day DATE, s TIME NOT NULL, --- start e TIME NOT NULL, --- end CHECK (e > s)); Now, i need a constraint to prevent overlapping timeintervals in