Re: SQL CONSTRAINTS - Constraining time values from two attributes on

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on
Date: 2001-10-05 23:01:29
Message-ID: 9ple49$2cgu$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)
);

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-10-05 23:31:27 Re: Quotes and spaces
Previous Message Josh Berkus 2001-10-05 22:51:07 Re: Quotes and spaces