Re: Does RAISE EXCEPTION rollback previous commands in a stored function?

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Does RAISE EXCEPTION rollback previous commands in a stored function?
Date: 2016-03-02 09:47:56
Message-ID: CAADeyWi3aeMH56KzzWcEXi=-u=hubRk3bPW5bJ0Qu16EM6U=XA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Laurenz,

how to set such a savepoint inside of a stored function?

Can I call "START TRANSACTION", and then at some point later in the same
stored function call RAISE EXCEPTION?

Regargs
Alex

On Wed, Mar 2, 2016 at 10:37 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
wrote:

> Andreas Kretschmer wrote:
> >> Alexander Farber <alexander(dot)farber(at)gmail(dot)com> hat am 1. März 2016 um
> 19:41
> >> geschrieben:
>

> >> in PostgreSQL 9.5 does RAISE EXCEPTION reliably rollback all previous
> >> commands in a stored function?
> >
> > Yes.
>
> That is, unless you set a savepoint to which you can rollback.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Evgeny Morozov 2016-03-02 09:48:07 Re: substring on bit(n) and bytea types is slow
Previous Message Alexander Farber 2016-03-02 09:45:36 How to ensure that a stored function always returns TRUE or FALSE?