Re: SQL CONSTRAINTS - Constraining time values from two attributes on - Mailing list pgsql-sql

From missive@frontiernet.net (Lee Harr)
Subject Re: SQL CONSTRAINTS - Constraining time values from two attributes on
Date
Msg-id 9ple49$2cgu$1@news.tht.net
Whole thread Raw
In response to SQL CONSTRAINTS - Constraining time values from two attributes on a table.  ("Maher, Christopher W" <christopher.w.maher@intel.com>)
List pgsql-sql
> I was looking for a solution on how to write a constraint into a ' create
> table ' expression that would ensure that one ' TIME ' attribute value
> called arrival_time (declared as TIME) is allways constrained to have a
> value that ensures it is allways after another attribute value called
> departure_time (declared as TIME). 
> Any know how this constraint would be written??
> 

CREATE TABLE tablename (arrival_time        timestamp,departure_time        timestamp CHECK (arrival_time <
departure_time)
);



pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: MEDIAN as custom aggregate?
Next
From: Stephan Szabo
Date:
Subject: Re: indexing and LIKE