Re: Enforcing Case

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Enforcing Case
Дата
Msg-id 20020822145323.GA415@wolff.to
обсуждение исходный текст
Ответ на Enforcing Case  (JDK <adahma@starport.org>)
Список pgsql-novice
On Thu, Aug 22, 2002 at 07:21:20 -0700,
  JDK <adahma@starport.org> wrote:
> I have a small single table database that multiple people enter data
> into, and I do some reporting from.  I would like to be able to
> force everything to upper case because currently it seems that ABCD
> or abcd or AbCd are all treated as unique, and it cause me problems
> in reporting, not to mention it makes me nuts seeing the data in the
> tables all inconsistent like that.
>
> How would I force everything to upper case?

You can use a check constraint. Something like
col1 text constraint upper_only check (col1 ~ '^[A-Z]$')

Note this ONLY allows uppercase. If you just want to ban lowercase
then you need to change the constraint (but you probably want more than
this).

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

Предыдущее
От: JDK
Дата:
Сообщение: Enforcing Case
Следующее
От: "Chad Thompson"
Дата:
Сообщение: Re: Simple but slow