enforcing alphabetic/numeric content in "char" column

Поиск
Список
Период
Сортировка
От Joel Rodrigues
Тема enforcing alphabetic/numeric content in "char" column
Дата
Msg-id 3C8D48DD-F25A-11D6-A698-0005024EF27F@Phreaker.net
обсуждение исходный текст
Ответы Re: enforcing alphabetic/numeric content in "char" column
Re: enforcing alphabetic/numeric content in "char" column
Список pgsql-novice
Hello,

The task is to allow data entries like "007", leading zeros
included. I tried various numeric data types and they all trim
it down to "7". Using char(3) works, but I want to put a CHECK
on it to ensure no non-numeric data is entered. The following,
and numerous variations on it, do not work:

iso3dnum    char(3) CHECK (iso3dnum ~ '[0-9]')

Any suggestions ?

Cheers,
Joel



В списке pgsql-novice по дате отправления:

Предыдущее
От: "Schneider, Nina"
Дата:
Сообщение: postgres for skyrix
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Speed Performance Question