Skip site navigation (1) Skip section navigation (2)

Re: After insert trigger question

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: mmiranda(at)americatel(dot)com(dot)sv
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: After insert trigger question
Date: 2005-04-27 15:24:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Wed, Apr 27, 2005 at 08:45:44AM -0600,
 mmiranda(at)americatel(dot)com(dot)sv <mmiranda(at)americatel(dot)com(dot)sv> wrote 
 a message of 21 lines which said:

> I am concerned about how reliable is an before insert trigger, i
> made some computation in my trigger and i want that no matter what
> happens inside the trigger (exceptions, erros, divide by zero, etc)
> , the row must be inserted,

I do not think that pl/pgsql has exception handlers
( You
can raise exceptions but not catch them. Could you rewrite your
trigger function with another programming language? In Python, it
would be something like (not tested):

   ... your computations
   # Insert anyway
   return "OK"

In response to


pgsql-general by date

Next:From: Ned LillyDate: 2005-04-27 16:04:17
Subject: Re: OpenRPT (was Re: [ANNOUNCE] == PostgreSQL Weekly
Previous:From: Scott MarloweDate: 2005-04-27 15:23:19
Subject: Re: Reduce size of $PGDATA for "demo cdrom"?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group