Check constraint - Mailing list pgsql-general

From Francisco Reyes
Subject Check constraint
Date
Msg-id 20040317115933.B13349@zoraida.natserv.net
Whole thread Raw
Responses Re: Check constraint
Re: Check constraint
List pgsql-general
I have a "comment" field in a table that I want populated if another field
has a certain value. Is it possible to set a check constraint for this?

Example:
Let's say we have fields
Purchase_type smallint check(purchase_type <4)
comment       varchar

I need a check rule to something like (pseudo code)
check (if purchase_type = 3 then NOT NULL comment)


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Data Corruption in case of abrupt failure
Next
From: Richard Huxton
Date:
Subject: Re: Check constraint