pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: diary constraints
Date: Tue, 23 Aug 2005 11:06:42 +0200
Message-ID: <op.svyd9g1mth1vuj@localhost> (raw)
In-Reply-To: <200508230933.59043.gary.stainburn@ringways.co.uk>
References: <200508230933.59043.gary.stainburn@ringways.co.uk>


> 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.



view thread (6+ messages)  latest in thread

Message-ID: <op.svyd9g1mth1vuj@localhost>
Permalink:  ../op.svyd9g1mth1vuj@localhost/
Also on:    postgresql.org/message-id/op.svyd9g1mth1vuj@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lists@boutiquenumerique.com, gary.stainburn@ringways.co.uk
  Subject: Re: diary constraints
  In-Reply-To: <op.svyd9g1mth1vuj@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox