Re: How to capture error message and save to a table in PostgreSQL?

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: How to capture error message and save to a table in PostgreSQL?
Date: 2021-10-09 18:29:27
Message-ID: 4A26A02A-318A-4F46-B18B-860AE3756727@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> On Oct 9, 2021, at 12:22 PM, Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> wrote:
>
> Am Fri, Oct 08, 2021 at 10:45:45AM +0100 schrieb Shaozhong SHI:
>
>> I wish to test out to produce a table when data violates constraints when
>> insert into a new table with constraint set. How to capture and save error
>> message to a new table?
>
> That depends on how you access the table and at which level
> you wish the above to happen.
>
> You need to be less generic to get better help.
>
If there is a client application involved you might be better off validating the input there rather than going all the way to the server with bad data.

>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message JP 2021-10-10 20:45:08 Removing JSONB key across all elements of nested array
Previous Message Karsten Hilbert 2021-10-09 18:22:26 Re: How to capture error message and save to a table in PostgreSQL?