Re: Try catch error, return data - Mailing list pgsql-sql

From Karsten Hilbert
Subject Re: Try catch error, return data
Date
Msg-id YgzLgdYh2J0bnbCX@hermes.hilbert.loc
Whole thread Raw
In response to Try catch error, return data  (Shaozhong SHI <shishaozhong@gmail.com>)
List pgsql-sql
Am Wed, Feb 16, 2022 at 02:13:05AM +0000 schrieb Shaozhong SHI:

> In Python, one can use try statement to catch error, error can be stored as
> data.
>
> Can plpgsql catch and return error as data or a data table?

Yes, as The Fine Manual to be Read says:

    https://www.postgresql.org/docs/devel/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

    https://www.postgresql.org/docs/devel/plpgsql-errors-and-messages.html#PLPGSQL-STATEMENTS-RAISE

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



pgsql-sql by date:

Previous
From: Skylar Thompson
Date:
Subject: Re: Try catch error, return data
Next
From: Shaozhong SHI
Date:
Subject: Advancing the capability of Postgres and PostGIS