Re: diary constraints - Mailing list pgsql-sql

From PFC
Subject Re: diary constraints
Date
Msg-id op.svyd9g1mth1vuj@localhost
Whole thread Raw
In response to diary constraints  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
List pgsql-sql
> a) the finish is after the start

well, finish > start

> b) two allocations for a single vehicle don't overlap.

this one is a bit tricky !

- Check that there is no allocation in the table whose time period start,  
end includes either the start of the end of the reservation to insert, and  
that the time period of the reservation to insert does not contain either  
the start or end of any reservation in the table.

This is 4 selects, playing with order by limit 1 and indexes, it will be  
fast.


pgsql-sql by date:

Previous
From: Gnanavel S
Date:
Subject: Re: diary constraints
Next
From: "A. Kretschmer"
Date:
Subject: Re: diary constraints