Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f95KVTn24293 for ; Fri, 5 Oct 2001 16:31:29 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 142742; Fri, 05 Oct 2001 13:31:25 -0700 From: "Josh Berkus" Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on a table. To: "Maher, Christopher W" Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Fri, 05 Oct 2001 13:31:25 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===142742====davinci.ethosmedia.com===_" X-Archive-Number: 200110/93 X-Sequence-Number: 5048 This is a multi-part MIME message --_===142742====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Chris, > Hi, > 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?? Easy: CONSTRAINT arr_dep_time CHECK ( arrival_time > departure_time ) ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco --_===142742====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===142742====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===142742====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===142742====davinci.ethosmedia.com===_--