Re: How to force some char type columns to be stored in uppercase

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: How to force some char type columns to be stored in uppercase
Дата
Msg-id CAOR=d=3o5oaLTDY5BKpN9mh=DweX+CySgLypMm_Pd9U_338f8A@mail.gmail.com
обсуждение исходный текст
Ответ на How to force some char type columns to be stored in uppercase  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
2011/11/6 Andrus <kobruleht2@hot.ee>:
> in 8.1+ many char(n) type columns must be in uppercase in database.
> What is best way to force this ?
>
> Should insert and update triggers created for every table or is there better
> way,
> for example by creation domain or adding some attribute to column and
> creating global trigger?

A simple trigger like this should work fine. You're basically throwing
an upper() around the field in a function and calling that a trigger.
If you decided to do it in the application, then throwing a constraint
around each updated / inserted text col is pretty easy too.

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

Предыдущее
От: Sim Zacks
Дата:
Сообщение: Re: How to find owning schema in function
Следующее
От: NTPT
Дата:
Сообщение: Re: Re: [GENERAL] Named / preparsed / preplaned(prepared) queries - Feature proposal