Simple, Add constraint - Mailing list pgsql-novice

From nhrcommu@rochester.rr.com
Subject Simple, Add constraint
Date
Msg-id c3bd85c449d3f.49d3fc3bd85c4@nyroc.rr.com
Whole thread Raw
Responses Re: Simple, Add constraint  (Richard Broersma Jr <rabroersma@yahoo.com>)
List 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

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: meaning of "create role"
Next
From: Tom Lane
Date:
Subject: Re: meaning of "create role"