how do I CHECK 'field only contains characters 0-9 or space?'

From: Tom Strickland <tom(at)stricklandc(dot)demon(dot)co(dot)uk>
To: Postgres Novice <pgsql-novice(at)postgresql(dot)org>
Subject: how do I CHECK 'field only contains characters 0-9 or space?'
Date: 2001-03-25 11:52:38
Message-ID: 20010325125237.W848@lyra.coulter
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

The subject says it all really. I have a phone no. field of type
VARCHAR(15) and would like to add a check that says 'only allow
numbers or the space character in this field'. Can I do this with a
CHECK (and if so how?) or do I need a trigger?

Thanks,
Tom

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lars Forseth 2001-03-25 12:05:03 On Postgres and permissions, cant read a file into a table
Previous Message Frank Hilliard 2001-03-24 18:50:41 PostgreSQL/CF Guestbook