Search Postgresql Archives

Re: After insert trigger question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 27, 2005 at 08:45:44AM -0600,
 mmiranda@xxxxxxxxxxxxxxxxx <mmiranda@xxxxxxxxxxxxxxxxx> 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
(http://www.postgresql.org/docs/7.4/interactive/plpgsql-errors-and-messages.html). 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):

try:
   ... your computations
finally:
   # Insert anyway
   return "OK"

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux