Received: from moutvdom00.kundenserver.de (moutvdom00.kundenserver.de [195.20.224.149]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f95L7En31438 for ; Fri, 5 Oct 2001 17:07:14 -0400 (EDT) (envelope-from peter_e@gmx.net) Received: from [195.20.224.204] (helo=mrvdom00.schlund.de) by moutvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 15pcBa-0001jP-00; Fri, 5 Oct 2001 23:07:10 +0200 Received: from p3e9e6e9a.dip0.t-ipconnect.de ([62.158.110.154]) by mrvdom00.schlund.de with esmtp (Exim 2.12 #2) id 15pcBa-0004GJ-00; Fri, 5 Oct 2001 23:07:10 +0200 Date: Fri, 5 Oct 2001 23:12:19 +0200 (CEST) From: Peter Eisentraut X-Sender: To: "Maher, Christopher W" cc: "'pgsql-sql@postgresql.org'" Subject: Re: SQL CONSTRAINTS - Constraining time values from two In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200110/96 X-Sequence-Number: 5051 Maher, Christopher W writes: > 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). create table test ( arrival_time time, departure_time time, check (arrival_time < departure_time) ); insert into test values ('12:00', '14:30'); INSERT 20651 1 insert into test values ('12:00', '9:45'); ERROR: ExecAppend: rejected due to CHECK constraint $1 -- Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter