pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Maher, Christopher W <christopher.w.maher@intel.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on	 a table.
Date: Fri, 05 Oct 2001 13:31:25 -0700
Message-ID: <web-142742@davinci.ethosmedia.com> (raw)
In-Reply-To: <C406DCEF4576D511843B0002A5071ED54C9B5A@irsmsx104.ir.intel.com>

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







view thread (4+ messages)  latest in thread

Message-ID: <web-142742@davinci.ethosmedia.com>
Permalink:  ../web-142742@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-142742@davinci.ethosmedia.com

 · 

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: josh@agliodbs.com, christopher.w.maher@intel.com
  Subject: Re: SQL CONSTRAINTS - Constraining time values from two attributes on	 a table.
  In-Reply-To: <web-142742@davinci.ethosmedia.com>

* 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