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:45:25
Message-ID: 200505201245.25229.josh@agliodbs.com (view raw or flat)
Thread:
Lists: sfpug
Adi,

> Sorry, I'm unclear on how this would help since I'm worried about an
> intervening insert rather than an update. Am I missing something?

Oh, yeah, you're right.  You'd have to exclusive lock the table.

What you want to do really doesn't work as a constraint.    Even as a trigger, 
it would be querying the entire table every time you do an insert.  THough I 
suppose you're doing that anyway.

And what about updates?

Perhaps you do want a BEFORE INSERT OR UPDATE trigger ...

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

sfpug by date

Next:From: Josh BerkusDate: 2005-05-20 19:50:34
Subject: Re: reservation overlap constraint checking?
Previous:From: AdityaDate: 2005-05-20 19:44:32
Subject: Re: reservation overlap constraint checking?

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