pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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




view thread (5+ messages)  latest in thread

Message-ID: <4117AA90.9080704@base.ro>
Permalink:  ../4117AA90.9080704@base.ro/
Also on:    postgresql.org/message-id/4117AA90.9080704@base.ro

 · 

reply

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