Re: Tidying values on variable instantiation

Поиск
Список
Период
Сортировка
От Russell Simpkins
Тема Re: Tidying values on variable instantiation
Дата
Msg-id BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl
обсуждение исходный текст
Ответ на Tidying values on variable instantiation  ("Bath, David" <dave.bath@unix.net>)
Список pgsql-sql
> Desired Outcome(s):
> * I would like to have the convenience of declaring a column that obeys
>  a constraint (similar to using a domain), but allows a "tidy-up" as the
>  value is created BEFORE asserting the constraint.  This *might* be
>  termed a "domain trigger".  (Perhaps even a WORM is possible!).
> * I would like to able to declare columns as
>  "trimmed_varchar(n)".
> * I'd like to be able to use the same approach for other "weak domains".

I'm not sure these any easier way to do this than with tirggers.

If the daunting task would writing a large number of triggers, I would write 
sql or php to generate all the triggers. Remember that you can introspect 
the db using the system catalogs. I've had a lot of good results generating 
triggers and sql using Middlegen and Velocity.


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Tidying values on variable instantiation
Следующее
От: "Greg Patnude"
Дата:
Сообщение: Re: Tidying values on variable instantiation