Thread: Postgres 8.0 -> BEGIN EXCEPTION END Syntax????

Postgres 8.0 -> BEGIN EXCEPTION END Syntax????

From
Daniel Schuchardt
Date:
Hi ,

can anybody tell me the postgres - syntax for begin excepion end if I
want to ignore the error?

BEGIN
  exception ...
EXCEPTION
  WHEN OTHERS THEN ?????????????what to write for do nothing?????????
END;

in oracle it's

WHEN OTHERS THEN null; but this syntax doesn't work in postgres.

thnx

Daniel

Re: Postgres 8.0 -> BEGIN EXCEPTION END Syntax????

From
Gaetano Mendola
Date:
Daniel Schuchardt wrote:

 > Hi ,
 >
 > can anybody tell me the postgres - syntax for begin excepion end if I
 > want to ignore the error?
 >
 > BEGIN
 >  exception ...
 > EXCEPTION
 >  WHEN OTHERS THEN ?????????????what to write for do nothing?????????
 > END;
 >
 > in oracle it's
 >
 > WHEN OTHERS THEN null; but this syntax doesn't work in postgres.

This for sure is not the best solution, but try:

WHEN OTHERS THEN PERFORM 0;



Regards
Gaetano Mendola