pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roberto Mello <rmello@cc.usu.edu>
To: Maurício Sessue Otta <mauricio@cristorei.com.br>
Cc: LISTA POSTGRES <pgsql-sql@postgresql.org>
Subject: Re: Trigger para fazer log
Date: Thu, 6 Feb 2003 08:58:09 -0700
Message-ID: <20030206155809.GF27389@cc.usu.edu> (raw)
In-Reply-To: <002301c2cdd8$30b82640$830101c0@mauricio1>
References: <002301c2cdd8$30b82640$830101c0@mauricio1>

On Thu, Feb 06, 2003 at 10:06:32AM -0200, Maurício Sessue Otta wrote:
> 
> Quando está "EXCEPTION", o que deveria ser guardado no "log" também é desfeito. Quando coloco "NOTICE", a
> informação vai para o LOG.
> 
> Como fazer para o trigger gerar uma "EXCEPTION" e mesmo assim gravar em outra tabela?!?!

Não dá. Quando você levanta uma exceção (exception) o controle volta para
quem chamou o gatilho. Não há como contornar, que eu saiba.

Você tem que fazer a inserção na relação desejada antes de levantar a
exceção (talvez chamando outra função que o faça).

-Roberto

P.S.: Tomaz, you understood his question correctly :-)

-- 
+----|        Roberto Mello   -    http://www.brasileiro.net/  |------+
+       Computer Science Graduate Student, Utah State University      +
+       USU Free Software & GNU/Linux Club - http://fslc.usu.edu/     +
I'm not super man. But I am very dense.



view thread (3+ messages)

Message-ID: <20030206155809.GF27389@cc.usu.edu>
Permalink:  ../20030206155809.GF27389@cc.usu.edu/
Also on:    postgresql.org/message-id/20030206155809.GF27389@cc.usu.edu

 · 

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: rmello@cc.usu.edu, mauricio@cristorei.com.br
  Subject: Re: Trigger para fazer log
  In-Reply-To: <20030206155809.GF27389@cc.usu.edu>

* 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