Re: How can I get and handle the status of sql statements that run in plpgsql ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Gauthier <davegauthierpg(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I get and handle the status of sql statements that run in plpgsql ?
Date: 2018-10-03 16:34:33
Message-ID: CAKFQuwZ7Tmg3GA+7RpAHtegK5CeMviYKv8_0X+kHEEhAwO_-Yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 3, 2018 at 9:25 AM, David Gauthier <davegauthierpg(at)gmail(dot)com>
wrote:

> Is that how you detect if nothing was updated
>

https://www.postgresql.org/docs/10/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

Given your concerns and examples you might also want to look into
serializable isolation; it is much more robust.

https://www.postgresql.org/docs/10/static/transaction-iso.html#XACT-SERIALIZABLE

If your concern isn't related to concurrency though you should just setup
tests to ensure the coding logic is correct and then let it run without all
the double-checking in production.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2018-10-03 16:35:46 Re: How can I get and handle the status of sql statements that run in plpgsql ?
Previous Message David Gauthier 2018-10-03 16:25:48 Re: How can I get and handle the status of sql statements that run in plpgsql ?