nocfbot-0002-DO-NOT-PUSH-IT.patch

application/x-patch

Filename: nocfbot-0002-DO-NOT-PUSH-IT.patch
Type: application/x-patch
Part: 1
Message: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v2-0002
Subject: !!DO NOT PUSH IT!!
File+
src/backend/executor/execPartition.c 1 1
src/backend/optimizer/util/plancat.c 2 2
From 8ee39bbf4804eb653b3db5d1527f5f6cceb2d72d Mon Sep 17 00:00:00 2001
From: Mikhail Nikalayeu <nkey@toloka.ai>
Date: Thu, 18 Dec 2025 12:15:03 +0100
Subject: [PATCH v2 2/2] !!DO NOT PUSH IT!!

intentionally breaks PG to ensure the test actually covering possible issues
---
 src/backend/executor/execPartition.c | 2 +-
 src/backend/optimizer/util/plancat.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index e30db12113b..fe18fac371b 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -807,7 +807,7 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
 			 * same set as arbiters during REINDEX CONCURRENTLY, to avoid
 			 * spurious "duplicate key" errors.
 			 */
-			if (unparented_idxs && arbiterIndexes)
+			if (unparented_idxs && arbiterIndexes && false)
 			{
 				foreach_int(unparented_i, unparented_idxs)
 				{
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index bf45c355b77..a888d230411 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -996,7 +996,7 @@ infer_arbiter_indexes(PlannerInfo *root)
 		 * negatives, we require that we include in the set of inferred
 		 * indexes at least one index that is marked valid.
 		 */
-		if (!idxForm->indisready)
+		if (!idxForm->indisvalid)
 			continue;
 
 		/*
@@ -1029,7 +1029,7 @@ infer_arbiter_indexes(PlannerInfo *root)
 			/* Consider this one a match already */
 			results = lappend_oid(results, idxForm->indexrelid);
 			foundValid |= idxForm->indisvalid;
-			continue;
+			break;
 		}
 		else if (indexOidFromConstraint != InvalidOid)
 		{
-- 
2.52.0