Skip site navigation (1) Skip section navigation (2)

Re: reservation overlap constraint checking?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Aditya <aditya(at)grot(dot)org>
Cc: sfpug(at)postgresql(dot)org
Subject: Re: reservation overlap constraint checking?
Date: 2005-05-20 19:50:34
Message-ID: 200505201250.34634.josh@agliodbs.com (view raw or flat)
Thread:
Lists: sfpug
Adi,

> so it turns out the best I can come up with is to use a function that
> returns a boolean since that works fine in a table constraint:

Constraints should never involve queries against rows other than the one being 
updated.  This is not guarenteed to be stable, nor to back up and restore 
correctly.

Use a trigger instead of a constraint.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

sfpug by date

Next:From: Jeff FrostDate: 2005-05-21 00:58:45
Subject: pg_dump/pg_restore in 8.0.3 dependency checking?
Previous:From: Josh BerkusDate: 2005-05-20 19:45:25
Subject: Re: reservation overlap constraint checking?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group