Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f95N4dn52867 for ; Fri, 5 Oct 2001 19:04:39 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f95N1Ti79545 for pgsql-sql@postgresql.org; Fri, 5 Oct 2001 19:01:29 -0400 (EDT) (envelope-from news) From: missive@frontiernet.net (Lee Harr) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on Date: Fri, 5 Oct 2001 23:01:29 +0000 (UTC) Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 14 Message-ID: <9ple49$2cgu$1@news.tht.net> References: Reply-To: missive@hotmail.com X-Complaints-To: scrappy@hub.org User-Agent: slrn/0.9.7.0 (FreeBSD) To: pgsql-sql@postgresql.org X-Archive-Number: 200110/156 X-Sequence-Number: 5111 > 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) );