Re: bug in stored generated column over domain with constraints.

2025-04-15 Thread Tom Lane
jian he writes: > Thanks for simplifying the tests, overall all looks good. OK, pushed and back-patched, but only to v14. I tried to make a variant that'd work in v13, but it caused ExecCheckPlanOutput to throw "Query provides a value for a generated column" errors for UPDATEs. That's surely re

Re: bug in stored generated column over domain with constraints.

2025-04-15 Thread jian he
On Tue, Apr 15, 2025 at 4:10 AM Tom Lane wrote: > > jian he writes: > > new patch attached. > > I looked this over. It's kind of astonishing that nobody has reported > this before, because AFAICT it's been broken since we invented > generated columns. > > > rewriteTargetListIU, expand_insert_tar

Re: bug in stored generated column over domain with constraints.

2025-04-14 Thread Tom Lane
jian he writes: > new patch attached. I looked this over. It's kind of astonishing that nobody has reported this before, because AFAICT it's been broken since we invented generated columns. > rewriteTargetListIU, expand_insert_targetlist these two places can > make a null Const TargetEntry for

Re: bug in stored generated column over domain with constraints.

2025-04-10 Thread jian he
hi. new patch attached. rewriteTargetListIU, expand_insert_targetlist these two places can make a null Const TargetEntry for the generated column in an INSERT operation. but since this problem only occurs in INSERT, so i placed the logic within expand_insert_targetlist would be appropriate? The

Re: bug in stored generated column over domain with constraints.

2025-02-25 Thread jian he
hi. comments refined and minor aesthetic adjustments made. From 22ef7ce384de3098fc19ae0bb9bc9777b269b8ec Mon Sep 17 00:00:00 2001 From: jian he Date: Wed, 26 Feb 2025 11:29:04 +0800 Subject: [PATCH v2 1/1] fix default insertion for stored generated column with domain over constraints. create do

bug in stored generated column over domain with constraints.

2025-02-25 Thread jian he
hi. create domain d1 as int not null; create domain d2 as int check (value > 1); create domain d3 as int check (value is not null); create table t0(b int, a d3 GENERATED ALWAYS as (b + 11) stored); insert into t0 values (1, default); ERROR: value for domain d3 violates check constraint "d3_check