From: Vlad Dimitriu <vlad.dimitriu@base.ro>
To: pgsql-sql@postgresql.org
Subject: Exception handling from trigger
Date: Mon, 09 Aug 2004 19:47:12 +0300
Message-ID: <4117AA90.9080704@base.ro> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: vlad.dimitriu@base.ro
Subject: Re: Exception handling from trigger
In-Reply-To: <4117AA90.9080704@base.ro>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox