Exception handling from trigger

From: Vlad Dimitriu <vlad(dot)dimitriu(at)base(dot)ro>
To: pgsql-sql(at)postgresql(dot)org
Subject: Exception handling from trigger
Date: 2004-08-09 16:47:12
Message-ID: 4117AA90.9080704@base.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rod Taylor 2004-08-09 16:52:54 Re: Exception handling from trigger
Previous Message Matt Nuzum 2004-08-09 14:56:21 Suggestions on storing re-occurring calendar events