Simple, Add constraint

From: nhrcommu(at)rochester(dot)rr(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: Simple, Add constraint
Date: 2007-06-20 15:12:38
Message-ID: c3bd85c449d3f.49d3fc3bd85c4@nyroc.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Working under the premise that "no question is too simple for this list"

Trying to add a constraint so that all phone numbers will be in a
'111-222-3333' format. Tried a few combos, with below the latest effort.

ALTER TABLE "fortour"."mine" ADD CONSTRAINT mine_cnstr_2 CHECK (phone
LIKE '999s999s9999')

and .... LIKE '999-999-9999'

A constraint for length is in place without a problem.
Any help appreciated.

Thanks,
Mike Ellsworth

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-06-20 15:34:56 Re: meaning of "create role"
Previous Message Andrew Sullivan 2007-06-20 14:48:10 On managerial choosing (was: Postgres VS Oracle)