Re: support fast default for domain with constraints

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-03-11T03:43:58Z
Lists: pgsql-hackers

Attachments

On Wed, Mar 11, 2026 at 1:18 AM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> here's an updated patch set.
>

+/*
+ * ExecPrepareExprWithContext: same as ExecPrepareExpr, but with an optional
+ * ErrorSaveContext for soft error handling during domain constraint
evaluation.
+ *
+ * See ExecInitExprWithContext for details on the escontext parameter.
+ */
+ExprState *
+ExecPrepareExprWithContext(Expr *node, EState *estate, Node *escontext)

Since ExecPrepareExprWithContext can be used more broadly, we should delete the
mention of domain constraint from the above comments.

I checked alter_table.sgml again, no need to change it, I think.

Slightly changed the regression test comments.



--
jian
https://www.enterprisedb.com/

Commits

  1. Enable fast default for domains with non-volatile constraints

  2. Extend DomainHasConstraints() to optionally check constraint volatility

  3. Restrict virtual columns to use built-in functions and types

  4. Replace EEOP_DONE with special steps for return/no return

  5. Add soft error handling to some expression nodes