pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error handling: Resume work after error
3+ messages / 2 participants
[nested] [flat]

* Error handling: Resume work after error
@ 2020-02-05 14:17 Raul Kaubi <raulkaubi@gmail.com>
  2020-02-05 15:03 ` Re: Error handling: Resume work after error hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Raul Kaubi @ 2020-02-05 14:17 UTC (permalink / raw)
  To: pgsql-general

Hi

PostgreSQL 12.1

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 ......;


Or is there different approach to achieve that..?


Thanks
Raul

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Error handling: Resume work after error
  2020-02-05 14:17 Error handling: Resume work after error Raul Kaubi <raulkaubi@gmail.com>
@ 2020-02-05 15:03 ` hubert depesz lubaczewski <depesz@depesz.com>
  2020-02-05 15:23   ` Re: Error handling: Resume work after error Raul Kaubi <raulkaubi@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: hubert depesz lubaczewski @ 2020-02-05 15:03 UTC (permalink / raw)
  To: Raul Kaubi <raulkaubi@gmail.com>; +Cc: pgsql-general

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Error handling: Resume work after error
  2020-02-05 14:17 Error handling: Resume work after error Raul Kaubi <raulkaubi@gmail.com>
  2020-02-05 15:03 ` Re: Error handling: Resume work after error hubert depesz lubaczewski <depesz@depesz.com>
@ 2020-02-05 15:23   ` Raul Kaubi <raulkaubi@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Raul Kaubi @ 2020-02-05 15:23 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: 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@depesz.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
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-02-05 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 14:17 Error handling: Resume work after error Raul Kaubi <raulkaubi@gmail.com>
2020-02-05 15:03 ` hubert depesz lubaczewski <depesz@depesz.com>
2020-02-05 15:23   ` Raul Kaubi <raulkaubi@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox