pgsql: Convert domain_in to report errors softly.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Convert domain_in to report errors softly.
Date: 2022-12-11 18:02:45
Message-ID: E1p4Qey-0033g7-3c@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Convert domain_in to report errors softly.

This is straightforward as far as it goes. However, it does not
attempt to trap errors occurring during the execution of domain
CHECK constraints. Since those are general user-defined
expressions, the only way to do that would involve starting up a
subtransaction for each check. Of course the entire point of
the soft-errors feature is to not need subtransactions, so that
would be self-defeating. For now, we'll rely on the assumption
that domain checks are written to avoid throwing errors.

Discussion: https://postgr.es/m/1181028.1670635727@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b8c0ffbd2c8038fbebe76b48616860a7efec66ae

Modified Files
--------------
doc/src/sgml/ref/create_domain.sgml | 5 ++++
src/backend/utils/adt/domains.c | 36 ++++++++++++++++++--------
src/test/regress/expected/domain.out | 50 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/domain.sql | 19 ++++++++++++++
4 files changed, 100 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-12-12 00:02:30 pgsql: Remove direct call to GetNewObjectId() for pg_auth_members.oid
Previous Message Tom Lane 2022-12-11 16:28:24 pgsql: Convert json_in and jsonb_in to report errors softly.