plpgsql NULL statement (was Re: [GENERAL] Postgres 8.0 -> BEGIN EXCEPTION END Syntax????)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема plpgsql NULL statement (was Re: [GENERAL] Postgres 8.0 -> BEGIN EXCEPTION END Syntax????)
Дата
Msg-id 3813.1092629541@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: plpgsql NULL statement (was Re: [GENERAL] Postgres 8.0 -> BEGIN EXCEPTION END Syntax????)  ("Andrew Dunstan" <andrew@dunslane.net>)
Re: plpgsql NULL statement (was Re: [GENERAL] Postgres  (Dennis Bjorklund <db@zigo.dhs.org>)
Список pgsql-hackers
Daniel Schuchardt <daniel_schuchardt@web.de> writes:
> 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.

In Postgres you just write nothing at all:
BEGIN...EXCEPTION  WHEN OTHERS THENEND;

However, it does appear that Oracle's PL/SQL has such a statement,
and that they don't like empty exception sections (or empty if/then/else
arms, etc), but *require* you to write "NULL;" in these places.
It seems to me that it would ease porting of Oracle functions if
we allowed a NULL statement in plpgsql.

It looks like about five minutes' work to add such a thing ... anyone
have any objections?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: pg_dump 'die_on_errors'
Следующее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: plpgsql NULL statement (was Re: [GENERAL] Postgres 8.0 -> BEGIN EXCEPTION END Syntax????)