From b8c0ffbd2c8038fbebe76b48616860a7efec66ae Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 11 Dec 2022 12:56:54 -0500 Subject: 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 --- doc/src/sgml/ref/create_domain.sgml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_domain.sgml b/doc/src/sgml/ref/create_domain.sgml index 82a0b874929..73f9f28d6cf 100644 --- a/doc/src/sgml/ref/create_domain.sgml +++ b/doc/src/sgml/ref/create_domain.sgml @@ -239,6 +239,11 @@ INSERT INTO tab (domcol) VALUES ((SELECT domcol FROM tab WHERE false)); DOMAIN), adjust the function definition, and re-add the constraint, thereby rechecking it against stored data. + + + It's also good practice to ensure that domain CHECK + expressions will not throw errors. + -- cgit v1.2.3