=== Applying patches on top of PostgreSQL commit ID f0178deecbb56283fda8f4c504c8fe16ce23e1a6 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Aug 6 17:09:32 UTC 2026 On branch cf/6054 nothing to commit, working tree clean === using 'git am' to apply patch ./v3-0001-add-RangeTblEntry-to-CreatePolicyStmt.patch === Applying: add RangeTblEntry to CreatePolicyStmt === using 'git am' to apply patch ./v3-0002-refactoring-CreatePolicy-split-policy-qual-check-qual.patch === Applying: refactoring CreatePolicy: split policy qual, check qual error: sha1 information is lacking or useless (src/backend/commands/policy.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 refactoring CreatePolicy: split policy qual, check qual 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". === using patch(1) to apply patch ./v3-0002-refactoring-CreatePolicy-split-policy-qual-check-qual.patch === patching file src/backend/commands/policy.c Hunk #2 succeeded at 577 (offset 12 lines). Hunk #3 succeeded at 590 (offset 12 lines). Hunk #4 succeeded at 627 (offset 12 lines). Hunk #5 succeeded at 648 (offset 12 lines). Hunk #6 succeeded at 725 (offset 12 lines). Hunk #7 succeeded at 750 (offset 12 lines). patching file src/backend/parser/gram.y Hunk #1 succeeded at 6098 (offset 69 lines). patching file src/backend/parser/parse_utilcmd.c Hunk #1 succeeded at 3234 (offset 26 lines). patching file src/backend/tcop/utility.c Hunk #1 succeeded at 1839 (offset 13 lines). patching file src/include/commands/policy.h patching file src/include/nodes/parsenodes.h Hunk #1 succeeded at 3229 (offset 120 lines). patching file src/include/parser/parse_utilcmd.h Hunk #1 succeeded at 28 with fuzz 1. [cf/6054 ad96229bd06] refactoring CreatePolicy: split policy qual, check qual Author: jian he Date: Tue Dec 23 09:58:44 2025 +0800 7 files changed, 86 insertions(+), 39 deletions(-) === using 'git am' to apply patch ./v3-0003-ALTER-TABLE-command-to-change-policy.patch === Applying: ALTER TABLE command to change policy error: sha1 information is lacking or useless (src/backend/commands/policy.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 ALTER TABLE command to change policy 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". === using patch(1) to apply patch ./v3-0003-ALTER-TABLE-command-to-change-policy.patch === patching file src/backend/commands/policy.c Hunk #2 succeeded at 755 (offset 12 lines). Hunk #3 succeeded at 1282 (offset 12 lines). patching file src/backend/commands/tablecmds.c Hunk #1 FAILED at 60. Hunk #2 succeeded at 211 (offset 3 lines). Hunk #3 succeeded at 593 (offset 45 lines). Hunk #4 FAILED at 652. Hunk #5 succeeded at 5563 (offset 95 lines). Hunk #6 succeeded at 6856 (offset 97 lines). Hunk #7 succeeded at 9832 (offset 99 lines). Hunk #8 succeeded at 15400 (offset 499 lines). Hunk #9 succeeded at 15601 (offset 499 lines). Hunk #10 FAILED at 15339. Hunk #11 succeeded at 16263 (offset 667 lines). Hunk #12 succeeded at 16428 (offset 667 lines). Hunk #13 succeeded at 16505 (offset 667 lines). Hunk #14 succeeded at 16558 (offset 667 lines). Hunk #15 succeeded at 16723 (offset 667 lines). 3 out of 15 hunks FAILED -- saving rejects to file src/backend/commands/tablecmds.c.rej patching file src/backend/parser/gram.y Hunk #1 succeeded at 6099 (offset 69 lines). patching file src/backend/utils/adt/ruleutils.c Hunk #1 FAILED at 33. Hunk #2 succeeded at 375 (offset 8 lines). Hunk #3 succeeded at 2973 (offset 362 lines). 1 out of 3 hunks FAILED -- saving rejects to file src/backend/utils/adt/ruleutils.c.rej patching file src/include/commands/policy.h patching file src/include/nodes/parsenodes.h Hunk #1 succeeded at 2628 (offset 120 lines). Hunk #2 succeeded at 3226 (offset 120 lines). patching file src/include/utils/ruleutils.h patching file src/test/modules/test_ddl_deparse/test_ddl_deparse.c Hunk #1 succeeded at 315 (offset 1 line). patching file src/test/regress/expected/rowsecurity.out Hunk #2 succeeded at 2789 (offset 131 lines). patching file src/test/regress/sql/rowsecurity.sql Hunk #2 succeeded at 1269 (offset 87 lines). Unstaged changes after reset: M src/backend/commands/policy.c M src/backend/commands/tablecmds.c M src/backend/parser/gram.y M src/backend/utils/adt/ruleutils.c M src/include/commands/policy.h M src/include/nodes/parsenodes.h M src/include/utils/ruleutils.h M src/test/modules/test_ddl_deparse/test_ddl_deparse.c M src/test/regress/expected/rowsecurity.out M src/test/regress/sql/rowsecurity.sql Removing src/backend/commands/tablecmds.c.rej Removing src/backend/utils/adt/ruleutils.c.rej === using 'git apply' to apply patch ./v3-0003-ALTER-TABLE-command-to-change-policy.patch === error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/backend/commands/tablecmds.c' with conflicts. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/backend/utils/adt/ruleutils.c' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/include/utils/ruleutils.h' cleanly. Applied patch to 'src/test/modules/test_ddl_deparse/test_ddl_deparse.c' cleanly. Applied patch to 'src/test/regress/expected/rowsecurity.out' cleanly. Applied patch to 'src/test/regress/sql/rowsecurity.sql' cleanly. U src/backend/commands/tablecmds.c diff --cc src/backend/commands/tablecmds.c index 2fa534413ea,cc1cfe9bf1d..00000000000 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@@ -61,8 -59,8 +61,12 @@@ #include "commands/comment.h" #include "commands/defrem.h" #include "commands/event_trigger.h" ++<<<<<<< ours +#include "commands/extension.h" +#include "commands/repack.h" ++======= + #include "commands/policy.h" ++>>>>>>> theirs #include "commands/sequence.h" #include "commands/tablecmds.h" #include "commands/tablespace.h" @@@ -693,7 -653,8 +701,12 @@@ static ObjectAddress ATExecAlterColumnT AlterTableCmd *cmd, LOCKMODE lockmode); static void RememberAllDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype, Relation rel, AttrNumber attnum, const char *colName); ++<<<<<<< ours +static void RememberWholeRowDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype, Relation rel); ++======= + static void CheckDepentPolicies(AlteredTableInfo *tab, AlterTableType subtype, + Relation rel, AttrNumber attnum, const char *colName); ++>>>>>>> theirs static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab); static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab); static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab); @@@ -15695,22 -15343,8 +15848,17 @@@ RememberAllDependentForRebuilding(Alter break; case PolicyRelationId: - - /* - * A policy can depend on a column because the column is - * specified in the policy's USING or WITH CHECK qual - * expressions. It might be possible to rewrite and recheck - * the policy expression, but punt for now. It's certainly - * easy enough to remove and recreate the policy; still, FIXME - * someday. - */ if (subtype == AT_AlterColumnType) ++<<<<<<< ours + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot alter type of a column used in a policy definition"), + errdetail("%s depends on column \"%s\".", + getObjectDescription(&foundObject, false), + colName))); ++======= + RememberPolicyForRebuilding(foundObject.objectId, tab); ++>>>>>>> theirs break; case AttrDefaultRelationId: