Re: support fast default for domain with constraints

2025-03-24 Thread jian he
hi. rebase because of commit: 8dd7c7cd0a2605d5301266a6b67a569d6a305106 also did minor enhancement. v4-0001 add function: ExecPrepareExprSafe and ExecInitExprSafe. v4-0002 add function: DomainHaveVolatileConstraints v4-0003 tests and apply fast default for domain with constraints. v4-0003 table w

Re: support fast default for domain with constraints

2025-03-06 Thread jian he
On Thu, Mar 6, 2025 at 11:04 AM jian he wrote: > > hi. > > rearrange the patch. > v3-0001 and v3-0002 is preparare patches. > v3-0001 add function: ExecPrepareExprSafe and ExecInitExprSafe. > v3-0002 add function: DomainHaveVolatileConstraints > i actually do need DomainHaveVolatileConstraints fo

Re: support fast default for domain with constraints

2025-03-05 Thread jian he
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 mast

Re: support fast default for domain with constraints

2025-03-05 Thread jian he
On Wed, Mar 5, 2025 at 11:13 AM Tom Lane wrote: > > This patch appears to summarily throw away a couple of > backwards-compatibility concerns that the previous round > took care to preserve: > > * not throwing an error if the default would fail the domain > constraints, but the table is empty so t

Re: support fast default for domain with constraints

2025-03-04 Thread Tom Lane
jian he writes: > Thanks to commit aaaf9449ec6be62cb0d30ed3588dc384f56274bf[1], > ExprState.escontext (ErrorSaveContext) was added, and > ExecEvalConstraintNotNull, > ExecEvalConstraintCheck were changed to use errsave instead of hard error. > Now we can use it to evaluate CoerceToDomain in a sof

support fast default for domain with constraints

2025-03-04 Thread jian he
00:00:00 2001 From: jian he Date: Wed, 5 Mar 2025 10:33:50 +0800 Subject: [PATCH v1 2/2] support fast default for domain with constraints This is primarily done by evaluating CoerceToDomain with soft error support. If we evaulte CoerceToDomain to false, it means in ATExecAddColumn, the defval n