1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Tom Lane
2022-12-11 12:56:54 -05:00
parent c60c9badba
commit b8c0ffbd2c
4 changed files with 100 additions and 10 deletions

View File

@ -239,6 +239,11 @@ INSERT INTO tab (domcol) VALUES ((SELECT domcol FROM tab WHERE false));
DOMAIN</command>), adjust the function definition, and re-add the
constraint, thereby rechecking it against stored data.
</para>
<para>
It's also good practice to ensure that domain <literal>CHECK</literal>
expressions will not throw errors.
</para>
</refsect1>
<refsect1>