This is a discussion on Simple error "exception when" in trigger within the pgsql Sql forums, part of the PostgreSQL category; --> It looks like exceptions are not raise in triggers as expected. example: 1. trigger function BEGIN EXCEPTION WHEN OTHERS ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| It looks like exceptions are not raise in triggers as expected. example: 1. trigger function BEGIN EXCEPTION WHEN OTHERS THEN RAISE NOTICE '% already exist.',NEW."UNAME"; END; I've tried a before and after trigger I've also tried the sql error codes for a violation of a UNIQUE constraint but still no luck. The the examples of the manual every example have a INSERT or UPDATE statement before the EXCEPTION WHEN and it's not done within a trigger. I would love to make it "GLOBAL" so it does not matter if the INSERT or UPDATE get called by a FUNCTION or not, thats why I want the constrain violation to be trapped within a TRIGGER. Is this possible or not ? Thanks a mil. |