=== Applying patches on top of PostgreSQL commit ID e633fa6351bd7e7bc10a5e74168eed4c15992851 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue Sep 16 21:35:19 UTC 2025 On branch cf/6010 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-ALTER-COLUMN-SET-EXPRESSION-GENERATED-STORED.patch === Applying: ALTER COLUMN SET EXPRESSION [GENERATED|STORED] Using index info to reconstruct a base tree... M src/backend/access/heap/heapam_handler.c M src/backend/commands/tablecmds.c M src/backend/parser/gram.y M src/test/regress/expected/generated_virtual.out M src/test/regress/expected/publication.out M src/test/regress/sql/generated_virtual.sql M src/test/regress/sql/publication.sql 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/sql/publication.sql Auto-merging src/test/regress/sql/generated_virtual.sql CONFLICT (content): Merge conflict in src/test/regress/sql/generated_virtual.sql Auto-merging src/test/regress/expected/publication.out Auto-merging src/test/regress/expected/generated_virtual.out CONFLICT (content): Merge conflict in src/test/regress/expected/generated_virtual.out Auto-merging src/backend/parser/gram.y Auto-merging src/backend/commands/tablecmds.c Auto-merging src/backend/access/heap/heapam_handler.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 ALTER COLUMN SET EXPRESSION [GENERATED|STORED] 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 doc/src/sgml/ref/alter_table.sgml M src/backend/access/heap/heapam_handler.c M src/backend/commands/tablecmds.c M src/backend/parser/gram.y M src/include/nodes/parsenodes.h M src/test/regress/expected/fast_default.out M src/test/regress/expected/generated_stored.out M src/test/regress/expected/generated_virtual.out M src/test/regress/expected/publication.out M src/test/regress/sql/fast_default.sql M src/test/regress/sql/generated_stored.sql M src/test/regress/sql/generated_virtual.sql M src/test/regress/sql/publication.sql M src/tools/pgindent/typedefs.list === using patch(1) to apply patch ./v1-0001-ALTER-COLUMN-SET-EXPRESSION-GENERATED-STORED.patch === patching file doc/src/sgml/ref/alter_table.sgml patching file src/backend/access/heap/heapam_handler.c patching file src/backend/commands/tablecmds.c Hunk #1 succeeded at 523 (offset 1 line). Hunk #2 succeeded at 5023 (offset 4 lines). Hunk #3 succeeded at 8582 (offset 4 lines). Hunk #4 succeeded at 8611 (offset 4 lines). Hunk #5 succeeded at 8639 (offset 4 lines). Hunk #6 succeeded at 8750 (offset 4 lines). Hunk #7 succeeded at 8831 (offset 4 lines). patching file src/backend/parser/gram.y patching file src/include/nodes/parsenodes.h patching file src/test/regress/expected/fast_default.out patching file src/test/regress/expected/generated_stored.out patching file src/test/regress/expected/generated_virtual.out Hunk #8 FAILED at 1745. 1 out of 8 hunks FAILED -- saving rejects to file src/test/regress/expected/generated_virtual.out.rej patching file src/test/regress/expected/publication.out patching file src/test/regress/sql/fast_default.sql patching file src/test/regress/sql/generated_stored.sql patching file src/test/regress/sql/generated_virtual.sql Hunk #8 FAILED at 904. 1 out of 8 hunks FAILED -- saving rejects to file src/test/regress/sql/generated_virtual.sql.rej patching file src/test/regress/sql/publication.sql patching file src/tools/pgindent/typedefs.list Unstaged changes after reset: M doc/src/sgml/ref/alter_table.sgml M src/backend/access/heap/heapam_handler.c M src/backend/commands/tablecmds.c M src/backend/parser/gram.y M src/include/nodes/parsenodes.h M src/test/regress/expected/fast_default.out M src/test/regress/expected/generated_stored.out M src/test/regress/expected/generated_virtual.out M src/test/regress/expected/publication.out M src/test/regress/sql/fast_default.sql M src/test/regress/sql/generated_stored.sql M src/test/regress/sql/generated_virtual.sql M src/test/regress/sql/publication.sql M src/tools/pgindent/typedefs.list Removing src/test/regress/expected/generated_virtual.out.rej Removing src/test/regress/sql/generated_virtual.sql.rej === using 'git apply' to apply patch ./v1-0001-ALTER-COLUMN-SET-EXPRESSION-GENERATED-STORED.patch === Applied patch to 'doc/src/sgml/ref/alter_table.sgml' cleanly. Applied patch to 'src/backend/access/heap/heapam_handler.c' cleanly. Applied patch to 'src/backend/commands/tablecmds.c' cleanly. Applied patch to 'src/backend/parser/gram.y' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' cleanly. Applied patch to 'src/test/regress/expected/fast_default.out' cleanly. Applied patch to 'src/test/regress/expected/generated_stored.out' cleanly. Applied patch to 'src/test/regress/expected/generated_virtual.out' with conflicts. Applied patch to 'src/test/regress/expected/publication.out' cleanly. Applied patch to 'src/test/regress/sql/fast_default.sql' cleanly. Applied patch to 'src/test/regress/sql/generated_stored.sql' cleanly. Applied patch to 'src/test/regress/sql/generated_virtual.sql' with conflicts. Applied patch to 'src/test/regress/sql/publication.sql' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/test/regress/expected/generated_virtual.out U src/test/regress/sql/generated_virtual.sql diff --cc src/test/regress/expected/generated_virtual.out index d8645192351,c7af751bfe8..00000000000 --- a/src/test/regress/expected/generated_virtual.out +++ b/src/test/regress/expected/generated_virtual.out @@@ -1636,26 -1745,4 +1745,30 @@@ select 1 from gtest32 t1 where exist (1 row) drop table gtest32; ++<<<<<<< ours +-- Ensure that virtual generated columns in constraint expressions are expanded +create table gtest33 (a int, b int generated always as (a * 2) virtual not null, check (b > 10)); +set constraint_exclusion to on; +-- should get a dummy Result, not a seq scan +explain (costs off) +select * from gtest33 where b < 10; + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) + +-- should get a dummy Result, not a seq scan +explain (costs off) +select * from gtest33 where b is null; + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) + +reset constraint_exclusion; +drop table gtest33; ++======= + DEALLOCATE get_generated_info; ++>>>>>>> theirs diff --cc src/test/regress/sql/generated_virtual.sql index adfe88d74ae,1b8af8c75ef..00000000000 --- a/src/test/regress/sql/generated_virtual.sql +++ b/src/test/regress/sql/generated_virtual.sql @@@ -869,17 -905,4 +905,21 @@@ select 1 from gtest32 t1 where exist drop table gtest32; ++<<<<<<< ours +-- Ensure that virtual generated columns in constraint expressions are expanded +create table gtest33 (a int, b int generated always as (a * 2) virtual not null, check (b > 10)); +set constraint_exclusion to on; + +-- should get a dummy Result, not a seq scan +explain (costs off) +select * from gtest33 where b < 10; + +-- should get a dummy Result, not a seq scan +explain (costs off) +select * from gtest33 where b is null; + +reset constraint_exclusion; +drop table gtest33; ++======= + DEALLOCATE get_generated_info; ++>>>>>>> theirs