Re: Setting up Field constraints

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Joseph Maxwell <jemaxwell(at)jaymax(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Setting up Field constraints
Date: 2002-03-07 00:19:11
Message-ID: 20020306161806.L18770-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wed, 6 Mar 2002, Joseph Maxwell wrote:

> Hello,
> I have created a DB and TABLE but would like to constrain one field to
> accept either "YES" or "NO" only. How can I set this up?

Probably something like:
Prior_Rx varchar(3) CHECK (Prior_Rx in ('Yes','No'))

In response to

Browse pgsql-general by date

  From Date Subject
Next Message andrew.clark 2002-03-07 00:32:05 Re: Have problems with 7.1 -> 7.2 upgrade
Previous Message Darren Ferguson 2002-03-07 00:18:09 Re: Have problems with 7.1 -> 7.2 upgrade