Обсуждение: Postgres 8.0 -> BEGIN EXCEPTION END Syntax????

Поиск
Список
Период
Сортировка

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

От
Daniel Schuchardt
Дата:
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????

От
Gaetano Mendola
Дата:
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