Re: PL/PgSQL: EXIT USING ROLLBACK

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: PL/PgSQL: EXIT USING ROLLBACK
Дата
Msg-id CA+TgmoaRtSOoQGYBU4p4VEekHocbUxtv+3e4jgH4AZaKdru4oQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PL/PgSQL: EXIT USING ROLLBACK  (Joel Jacobson <joel@trustly.com>)
Ответы Re: PL/PgSQL: EXIT USING ROLLBACK  (Joel Jacobson <joel@trustly.com>)
Re: PL/PgSQL: EXIT USING ROLLBACK  (Joel Jacobson <joel@trustly.com>)
Список pgsql-hackers
On Mon, Sep 1, 2014 at 5:08 AM, Joel Jacobson <joel@trustly.com> wrote:
> On Sat, Jul 26, 2014 at 8:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Basically my point is that this just seems like inventing another way to
>> do what one can already do with RAISE, and it doesn't have much redeeming
>> social value to justify the cognitive load of inventing another construct.
>
> The main difference is with RAISE EXCEPTION 'OK'; you cannot know if
> it was *your* line of code which throw the 'OK'-exception or if it
> came from some other function which was called in the block of code.

The real problem here is that if you're using PL/pgsql exceptions for
control-flow reasons, you are taking a huge performance hit for that
notational convenience.  I do agree that the syntax of PL/pgsql is
clunky and maybe we should fix that anyway, but I honestly can't
imagine too many people actually wanting to do this once they realize
what it does to the run time of their procedure (and in some cases,
the XID-consumption rate of their database).

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: RLS Design
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: PL/pgSQL 2