Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Simple error "e...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3437 of 3559
Post > Topic >>

Simple error "exception when" in trigger

by bartel@[EMAIL PROTECTED] Apr 25, 2008 at 12:20 AM

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.
 




 1 Posts in Topic:
Simple error "exception when" in trigger
bartel@[EMAIL PROTECTED]   2008-04-25 00:20:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 19:50:55 CDT 2008.