Trigger to force fields to lowercase at insert/update

Поиск
Список
Период
Сортировка
От Leonardo Boiko
Тема Trigger to force fields to lowercase at insert/update
Дата
Msg-id 20060426195255.GA5142@alameda.dreamhost.com
обсуждение исходный текст
Ответы Re: Trigger to force fields to lowercase at insert/update
Re: Trigger to force fields to lowercase at insert/update
Список pgsql-novice
Suppose I have a bunch of fields in different tables which I'd like to
always force to lowercase (since they represent case-insensitive data).
Suppose I want to do it at SQL level, not application level.  If the
user say "INSERT INTO foo VALUES ('Abc')", I want to really insert
'abc'.  Is there an elegant way of doing this? Some kind of trigger,
maybe? I have no experience with triggers or pl/sql, but I couldn't
come up with a solution general enough to be reused in multiple places.
Or is the premise a bad idea?


--
Leonardo Boiko
http://namakajiri.net

Вложения

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

Предыдущее
От: Mark Campbell
Дата:
Сообщение: Perl and psql variables
Следующее
От: richard
Дата:
Сообщение: running pg_dumpall as a cron job