CHECK vs BEFORE trigger - Mailing list pgsql-novice

From Keith Worthington
Subject CHECK vs BEFORE trigger
Date
Msg-id 20050422192320.M89340@narrowpathinc.com
Whole thread Raw
Responses Re: CHECK vs BEFORE trigger  (brew@theMode.com)
List pgsql-novice
Hi All,

I am about to create a new table that will store among other things two
dimensions.  The user requires that the smaller of the two dimesions always be
referred to as the width.

As I see it I can either implement a CHECK constraint and handle the error or
implement a BEFORE INSERT OR UPDATE trigger that checks the two values and
switches them if necessary.

If I implement the trigger is there any point in implementing the CHECK?

In this simple situation is there any reason to implement the CHECK and not
use a trigger?

Your comments will be appreciated.

Kind Regards,
Keith

pgsql-novice by date:

Previous
From: "Van Ingen, Lane"
Date:
Subject: Re: CHECK Constraints
Next
From: "Keith Worthington"
Date:
Subject: char or int vs varchar