| From: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> | 
|---|---|
| To: | Dennis Gearon <gearond(at)fireserve(dot)net> | 
| Cc: | <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: constraint help | 
| Date: | 2004-04-14 19:12:30 | 
| Message-ID: | Pine.LNX.4.33.0404141312240.31509-100000@css120.ihs.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Maybe natural join is what you want?
On Wed, 14 Apr 2004, Dennis Gearon wrote:
> I will have a table with, among other things, two time columns.
> As per my last post, I will be using a variable time for the day-to-day 
> boundary, versus the traditional 12pm.
> What I want to be able to do upon insert of a record with a pair of 
> times is to determine if the day to day boundary is between the times 
> that are in the record, and reject the record if that is true.
> For example, if the system wide constant for the day-to-day boundary 
> were 4AM local time, and I submitted a record like so:
>     INSERT INTO my_table(start_time, end_time) VALUES( '12:00'::TIME, 
> '14:30'::TIME );
> 
> that should succeed. However:
>     INSERT INTO my_table(start_time, end_time) VALUES( '12:00'::TIME, 
> '5:00'::TIME );
> 
> should fail.
> Any ideas wold be most appreciated.
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stephan Szabo | 2004-04-14 19:45:15 | Re: constraint help | 
| Previous Message | Josh Berkus | 2004-04-14 18:59:28 | Re: [HACKERS] Remove MySQL Tools from Source? |