From: | Raul Kaubi <raulkaubi(at)gmail(dot)com> |
---|---|
To: | depesz(at)depesz(dot)com |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Error handling: Resume work after error |
Date: | 2020-02-05 15:23:38 |
Message-ID: | CAO_+3-AV_UjU78XaEXJek_pAa9Fp-KuBASsd-3R__feWnXq1qg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Oh yeah, I must add new *begin ... exception .. end;* block between.
So like this:
BEGIN
>
BEGIN
> EXCEPTION when ..... then ..
> END;
>
> END;
At first I did like this:
BEGIN
.....
EXCEPTION when ..... then ..;
> END;
Raul
Kontakt hubert depesz lubaczewski (<depesz(at)depesz(dot)com>) kirjutas kuupäeval
K, 5. veebruar 2020 kell 17:03:
> On Wed, Feb 05, 2020 at 04:17:09PM +0200, Raul Kaubi wrote:
> > Let's say I want my procedure/function to resume work after specific
> error
> > ( duplicate_table ).
> > Is it possible to resume work after error..?
> > EXCEPTION
> > > WHEN duplicate_table then ......;
>
> Sure you can:
>
>
> https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>
> Best regards,
>
> depesz
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2020-02-05 15:43:34 | Re: Restore is failing |
Previous Message | Олег Самойлов | 2020-02-05 15:22:22 | Re: initialize and use variable in query |