Re: support fast default for domain with constraints

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-03-06T03:04:50Z
Lists: pgsql-hackers

Attachments

hi.

rearrange the patch.
v3-0001 and v3-0002 is preparare patches.
v3-0001 add function: ExecPrepareExprSafe and ExecInitExprSafe.
v3-0002 add function: DomainHaveVolatileConstraints


v3-0003 tests and apply fast default for domain with constraints.
v3-0003 table with empty rows aligned with master behavior.
also no table rewrite if the domain has volatile check constraints,
so less surprising behavior.

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