=== Applying patches on top of PostgreSQL commit ID 228a1f9542792c6533ef74c2e7aefad0da1d9a7a === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sun Apr 19 07:56:22 UTC 2026 On branch cf/6580 nothing to commit, working tree clean === using 'git am' to apply patch ./0005-Fix-REFRESH-MATERIALIZED-VIEW-CONCURRENTLY-performance_bug2.patch === Applying: Fix REFRESH MATERIALIZED VIEW CONCURRENTLY performance with nullable indexed columns === using 'git am' to apply patch ./0005-Fix-REFRESH-MATERIALIZED-VIEW-CONCURRENTLY-to-detect_bug1.patch === Applying: Fix REFRESH MATERIALIZED VIEW CONCURRENTLY to detect duplicate rows Using index info to reconstruct a base tree... M src/backend/commands/matview.c M src/test/regress/expected/matview.out M src/test/regress/sql/matview.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/matview.sql Auto-merging src/test/regress/expected/matview.out Auto-merging src/backend/commands/matview.c CONFLICT (content): Merge conflict in src/backend/commands/matview.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 Fix REFRESH MATERIALIZED VIEW CONCURRENTLY to detect duplicate rows 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 ./0005-Fix-REFRESH-MATERIALIZED-VIEW-CONCURRENTLY-to-detect_bug1.patch === patching file src/backend/commands/matview.c Hunk #1 succeeded at 607 (offset 1 line). Hunk #2 succeeded at 637 (offset 1 line). Hunk #3 FAILED at 678. Hunk #4 FAILED at 765. Hunk #5 succeeded at 848 (offset 54 lines). 2 out of 5 hunks FAILED -- saving rejects to file src/backend/commands/matview.c.rej patching file src/test/regress/expected/matview.out patching file src/test/regress/sql/matview.sql Unstaged changes after reset: M src/backend/commands/matview.c M src/test/regress/expected/matview.out M src/test/regress/sql/matview.sql Removing src/backend/commands/matview.c.rej === using 'git apply' to apply patch ./0005-Fix-REFRESH-MATERIALIZED-VIEW-CONCURRENTLY-to-detect_bug1.patch === Applied patch to 'src/backend/commands/matview.c' with conflicts. Applied patch to 'src/test/regress/expected/matview.out' cleanly. Applied patch to 'src/test/regress/sql/matview.sql' cleanly. U src/backend/commands/matview.c diff --cc src/backend/commands/matview.c index a47504992d6,2a1694f3b4e..00000000000 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@@ -716,7 -678,8 +679,12 @@@ refresh_by_match_merge(Oid matviewOid, tupdesc = matviewRel->rd_att; opUsedForQual = palloc0_array(Oid, relnatts); foundUniqueIndex = false; ++<<<<<<< ours + addedAnyQuals = false; ++======= + initStringInfo(&precheck_cond_buf); + precheck_has_cond = false; ++>>>>>>> theirs indexoidlist = RelationGetIndexList(matviewRel); @@@ -847,7 -766,31 +815,35 @@@ op, rightop, attrtype); ++<<<<<<< ours + addedAnyQuals = true; ++======= + foundUniqueIndex = true; + + /* + * Also accumulate the same condition for the duplicate-row + * pre-check, comparing newdata2 against newdata (instead of + * newdata against mv). This lets us detect rows that are + * duplicates with respect to the unique index semantics --- + * i.e. rows whose indexed columns are non-null and equal --- + * without falsely flagging rows whose indexed columns are + * NULL (which unique indexes treat as distinct). + */ + if (precheck_has_cond) + appendStringInfoString(&precheck_cond_buf, " AND "); + + leftop = quote_qualified_identifier("newdata2", + NameStr(attr->attname)); + rightop = quote_qualified_identifier("newdata", + NameStr(attr->attname)); + + generate_operator_clause(&precheck_cond_buf, + leftop, attrtype, + op, + rightop, attrtype); + + precheck_has_cond = true; ++>>>>>>> theirs } }