Using CHECK while CREATE'ing table

Поиск
Список
Период
Сортировка
От vj
Тема Using CHECK while CREATE'ing table
Дата
Msg-id a640f2fe-3f74-4a2b-b65e-7023f48035cc@3g2000yqk.googlegroups.com
обсуждение исходный текст
Ответы Re: Using CHECK while CREATE'ing table  (Richard Broersma <richard.broersma@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: backup getting larger and larger
Следующее
От: "Crowe, Eric"
Дата:
Сообщение: Possible postgre serverlog file handle leak