=== Applying patches on top of PostgreSQL commit ID 4c1a27e53a508f74883cda52a6c8612121d7fd6b === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Feb 26 00:08:24 UTC 2026 On branch cf/6460 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-Show-expression-of-virtual-columns-in-error-messa.patch === Applying: Show expression of virtual columns in error messages Using index info to reconstruct a base tree... M src/include/executor/executor.h M src/test/regress/expected/generated_virtual.out M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list Auto-merging src/test/regress/expected/generated_virtual.out CONFLICT (content): Merge conflict in src/test/regress/expected/generated_virtual.out Auto-merging src/include/executor/executor.h error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Show expression of virtual columns in error messages When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/executor/execMain.c M src/backend/replication/logical/conflict.c M src/include/executor/executor.h M src/test/regress/expected/generated_virtual.out M src/test/regress/expected/partition_merge.out M src/tools/pgindent/typedefs.list === using patch(1) to apply patch ./v2-0001-Show-expression-of-virtual-columns-in-error-messa.patch === patching file src/backend/executor/execMain.c patching file src/backend/replication/logical/conflict.c patching file src/include/executor/executor.h patching file src/test/regress/expected/generated_virtual.out Hunk #1 FAILED at 638. Hunk #2 succeeded at 684 (offset 18 lines). Hunk #3 succeeded at 705 (offset 18 lines). Hunk #4 succeeded at 730 (offset 18 lines). 1 out of 4 hunks FAILED -- saving rejects to file src/test/regress/expected/generated_virtual.out.rej patching file src/test/regress/expected/partition_merge.out patching file src/tools/pgindent/typedefs.list Hunk #1 succeeded at 2955 (offset 5 lines). Unstaged changes after reset: M src/backend/executor/execMain.c M src/backend/replication/logical/conflict.c M src/include/executor/executor.h M src/test/regress/expected/generated_virtual.out M src/test/regress/expected/partition_merge.out M src/tools/pgindent/typedefs.list Removing src/test/regress/expected/generated_virtual.out.rej === using 'git apply' to apply patch ./v2-0001-Show-expression-of-virtual-columns-in-error-messa.patch === Applied patch to 'src/backend/executor/execMain.c' cleanly. Applied patch to 'src/backend/replication/logical/conflict.c' cleanly. Applied patch to 'src/include/executor/executor.h' cleanly. Applied patch to 'src/test/regress/expected/generated_virtual.out' with conflicts. Applied patch to 'src/test/regress/expected/partition_merge.out' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/test/regress/expected/generated_virtual.out diff --cc src/test/regress/expected/generated_virtual.out index 6dab60c937b,a55470fd47f..00000000000 --- a/src/test/regress/expected/generated_virtual.out +++ b/src/test/regress/expected/generated_virtual.out @@@ -638,31 -638,13 +638,41 @@@ CREATE TABLE gtest20 (a int PRIMARY KEY INSERT INTO gtest20 (a) VALUES (10); -- ok INSERT INTO gtest20 (a) VALUES (30); -- violates constraint ERROR: new row for relation "gtest20" violates check constraint "gtest20_b_check" ++<<<<<<< ours +DETAIL: Failing row contains (30, virtual). +ALTER TABLE gtest20 ALTER COLUMN b SET EXPRESSION AS (a * 100); -- violates constraint +ERROR: check constraint "gtest20_b_check" of relation "gtest20" is violated by some row +ALTER TABLE gtest20 ALTER COLUMN b SET EXPRESSION AS (a * 3); -- ok +-- table rewrite should not happen +SELECT pg_relation_filenode('gtest20') AS gtest20_filenode \gset +ALTER TABLE gtest20 ALTER COLUMN b SET EXPRESSION AS (a * 4), ADD COLUMN c INT DEFAULT 11; +SELECT pg_relation_filenode('gtest20') = :gtest20_filenode AS is_same_file; + is_same_file +-------------- + t +(1 row) + +\d gtest20 + Table "generated_virtual_tests.gtest20" + Column | Type | Collation | Nullable | Default +--------+---------+-----------+----------+----------------------------- + a | integer | | not null | + b | integer | | | generated always as (a * 4) + c | integer | | | 11 +Indexes: + "gtest20_pkey" PRIMARY KEY, btree (a) +Check constraints: + "gtest20_b_check" CHECK (b < 50) + ++======= + DETAIL: Failing row contains (30, (30 * 2)). + ALTER TABLE gtest20 ALTER COLUMN b SET EXPRESSION AS (a * 100); -- violates constraint (currently not supported) + ERROR: ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns in tables with check constraints + DETAIL: Column "b" of relation "gtest20" is a virtual generated column. + ALTER TABLE gtest20 ALTER COLUMN b SET EXPRESSION AS (a * 3); -- ok (currently not supported) + ERROR: ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns in tables with check constraints + DETAIL: Column "b" of relation "gtest20" is a virtual generated column. ++>>>>>>> theirs CREATE TABLE gtest20a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) VIRTUAL); INSERT INTO gtest20a (a) VALUES (10); INSERT INTO gtest20a (a) VALUES (30);