View Single Post

   
  #1 (permalink)  
Old 04-17-2008, 10:51 PM
Verena Ruff
 
Posts: n/a
Default Re: error handling

Hello,

sorry for answering so late, ...
> I do not know if there is an specific error handler built in postgresql (besides error-codes).
>
> If you break the unique constraint an error will be thrown. A
> workaround may be to launch a trigger BEFORE the insertion and do whatever is necessary within the trigger.
>

This is possibillity I was thinking of, too. But if there are many
inserts and (probably) only a few of them would break the unique
constraint, there would be a great overhead. This was what I'd like to
avoid with a custom error handler.

Regards,
Verena



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote