Using CHECK while CREATE'ing table - Mailing list pgsql-general

From vj
Subject Using CHECK while CREATE'ing table
Date
Msg-id a640f2fe-3f74-4a2b-b65e-7023f48035cc@3g2000yqk.googlegroups.com
Whole thread Raw
Responses Re: Using CHECK while CREATE'ing table
List pgsql-general
Hi All,

 I am new to postgreSQL and have a working experience with SQLite.
 While i am creating a table, i want to use constraints or more so -
use checks to see that

1. the email address is valid [a basic check with no bells and
whistles is good enuf for me].
2. On a separate column entry, i would also want to check that the
string is a valid hex string i.e no characters other than [0-9 and (A-
F or a-f)] are present.

What is the simplest and most efficient way to achieve this without
having to re-invent the wheel.

Should i trigger actions during "insert" process or should i use
constraints/checks during "create" process??

TIA

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: backup getting larger and larger
Next
From: "Crowe, Eric"
Date:
Subject: Possible postgre serverlog file handle leak