On Wed, Nov 21, 2007 at 09:14:14AM +0100, Bart Degryse wrote:
> I would do something like this (not tested, but conceptually working):

Hello,

> BEGIN
> if old.story is not null and new.story != old.story then
>   new.story = sanitize_text(new.story);
> end if;
> --checks on other field can be included here, eg
> if old.otherfield is not null and new.otherfield != old.otherfield then
>   new.otherfield = sanitize_text(new.otherfield);
> end if;

But if I test a non-existent column for not being null I will have an 
exception, no?

Otherwise this is a nice way of doing it.

Thanks,

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to