Exception handling from trigger - Mailing list pgsql-sql

From Vlad Dimitriu
Subject Exception handling from trigger
Date
Msg-id 4117AA90.9080704@base.ro
Whole thread Raw
Responses Re: Exception handling from trigger  (Rod Taylor <pg@rbt.ca>)
Re: Exception handling from trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hello,

I would like to handle the exceptions that a database returns. For example,
if a "mycolumn" column is defined as varchar(64), I'd like to catch
if the new.mycolumn is larger than 64 with my own trigger
(for cutoms, internationalized messages, etc ..). So I did,
but the database catch this error before my 'before insert'-trigger
(using character_length(new.mycolumn) ...).

Is this way of handling exceptions possible in postgres ?
If so, what is the normal way to handle this exceptions, from a
plpgsql/trigger(rule??) perspective ?


Thank you ...


Vlad Dimitriu



pgsql-sql by date:

Previous
From: Matt Nuzum
Date:
Subject: Suggestions on storing re-occurring calendar events
Next
From: Rod Taylor
Date:
Subject: Re: Exception handling from trigger