pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: missive@frontiernet.net
To: pgsql-sql@postgresql.org
Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on
Date: Fri, 5 Oct 2001 23:01:29 +0000 (UTC)
Message-ID: <9ple49$2cgu$1@news.tht.net> (raw)
References: <C406DCEF4576D511843B0002A5071ED54C9B5A@irsmsx104.ir.intel.com>

> 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)
);




view thread (4+ messages)

Message-ID: <9ple49$2cgu$1@news.tht.net>
Permalink:  ../9ple49$2cgu$1@news.tht.net/
Also on:    postgresql.org/message-id/9ple49$2cgu$1@news.tht.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: missive@frontiernet.net
  Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on
  In-Reply-To: <9ple49$2cgu$1@news.tht.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox