2009/11/18 George <[email protected]>:
> Bom dia,
>
> Gostaria de saber dntro da trigger de qualquer tabela pegar o erro geral que
> deu na tabela e colocar dentro de outra tabela o erro , exemplo :
>
>
> BEGIN
>
> new.id = null
>
> EXCEPTION WHEN  GERAL THEN
>  INSERT INTO TABELA_DADOS_COM_ERROS (TG_OP,SQLERRM)
> DE ERROS;
>
> return new;
>
>
> Existe alguma maneira de generalizar (GERAL) qualquer tipo erro, sem ter que
> tratar um a um ? eu Uso o postgresql 8.2.
>


WHEN OTHERS THEN

Veja em:
http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
"The special condition name OTHERS matches every error type except
QUERY_CANCELED."

Osvaldo
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a